Part Number Hot Search : 
F1006 N1302 DEVICE UN2212 KSR1008 MP120D2 1H683J 74670
Product Description
Full Text Search
 

To Download 101-0536 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  edisplay (op7200) ? vga operator control panel user?s manual 019?0116 ? 090529?m
edisplay (op7200) digi international inc. www.rabbit.com op7200 user?s manual part number 019-0116 ? 090529?m ? printed in u.s.a. ?2002?2009 digi international inc. ? all rights reserved. digi international reserves the right to make changes and improvements to its products without providing notice. trademarks rabbit and dynamic c are registered trademarks of digi international inc. rabbit 2000, rabbitcore, and rabbitnet are trademarks of digi international inc. no part of the contents of this manual may be reproduced or transmitted in any form or by any means without the express written permission of digi international. permission is granted to make one or more copies as long as the copyright page contained therein is included. these copies of the manuals may not be let or sold for any reason without the express written permission of digi international. the latest revision of this manual is available on the rabbit web site, www.rabbit.com , for free, unregistered download.
user?s manual t able of c ontents chapter 1. introduction 1 1.1 features .................................................................................................................. ...............................1 1.2 development and evaluation tools.......................................................................................... ............3 1.2.1 tool kit ................................................................................................................ .........................3 1.2.2 software ................................................................................................................ ........................4 1.3 rabbitnet peripheral cards ................................................................................................ ..................5 1.4 ce compliance ............................................................................................................. ........................6 1.4.1 design guidelines ....................................................................................................... ..................7 1.4.2 interfacing the op7200 to other devices ................................................................................. ....7 chapter 2. getting started 9 2.1 power supply connections .................................................................................................. ...............10 2.2 demonstration program on power-up ......................................................................................... ......11 2.3 programming cable connections ............................................................................................. ..........12 2.4 installing dynamic c ...................................................................................................... ....................13 2.5 starting dynamic c ........................................................................................................ ....................13 2.6 pong.c .................................................................................................................... ..........................14 2.7 where do i go from here? .................................................................................................. .............14 2.8 remove battery tab ........................................................................................................ ...................15 chapter 3. subsystems 17 3.1 op7200 pinouts ............................................................................................................ ......................18 3.1.1 headers and screw terminals............................................................................................. ........18 3.2 indicators ................................................................................................................ ............................19 3.2.1 leds .................................................................................................................... .......................19 3.2.2 buzzer .................................................................................................................. .......................19 3.3 digital i/o ............................................................................................................... ............................20 3.3.1 digital inputs.......................................................................................................... .....................20 3.3.2 digital outputs......................................................................................................... ...................22 3.4 analog features (op7200 only) ............................................................................................. ............24 3.4.1 a/d converter inputs.................................................................................................... ..............24 3.4.2 analog current measurements ............................................................................................. ......27 3.4.3 calibrating the a/d converter chip ...................................................................................... .....28 3.4.4 touchscreen ............................................................................................................. ...................31 3.4.5 analog supply voltage................................................................................................... ............31 3.4.6 a/d converter reference voltage (+v) .................................................................................... .32 3.5 serial communication ...................................................................................................... ..................33 3.5.1 rs-232 .................................................................................................................. ......................34 3.5.2 rs-485 .................................................................................................................. ......................34 3.5.3 rabbitnet port.......................................................................................................... ...................36 3.5.4 ethernet port ........................................................................................................... ....................37 3.5.5 programming port ........................................................................................................ ...............38 3.6 memory.................................................................................................................... ...........................39 3.6.1 sram .................................................................................................................... .....................39 3.6.2 flash memory ............................................................................................................ .................39 3.7 liquid crystal display controller ......................................................................................... .............40
edisplay (op7200) 3.8 keypad .................................................................................................................... ........................... 41 3.9 op7200 cpld............................................................................................................... ..................... 42 3.10 programming cable........................................................................................................ .................. 44 3.10.1 changing between program mode and run mode.................................................................. 44 3.11 other hardware ........................................................................................................... ..................... 45 3.11.1 spectrum spreader...................................................................................................... .............. 45 chapter 4. software 47 4.1 running dynamic c......................................................................................................... .................. 47 4.1.1 upgrading dynamic c..................................................................................................... ........... 49 4.1.2 accessing and downloading dynamic c libraries ................................................................... 50 4.2 font and bitmap converter ................................................................................................. ............... 51 4.3 sample programs........................................................................................................... ..................... 52 4.3.1 general op7200 sample programs .......................................................................................... .. 52 4.3.2 digital i/o............................................................................................................. ...................... 52 4.3.3 serial communication .................................................................................................... ............ 53 4.3.4 a/d converter inputs .................................................................................................... ............. 54 4.3.5 graphic display......................................................................................................... ................. 55 4.3.6 keypad.................................................................................................................. ...................... 55 4.3.7 touchscreen (op7200 only)............................................................................................... ........ 55 4.3.8 using system information from the rabbitcore module .......................................................... 56 4.4 op7200 libraries .......................................................................................................... ..................... 57 4.5 op7200 function apis...................................................................................................... ................. 58 4.5.1 board initialization.................................................................................................... ................. 58 4.5.2 digital i/o............................................................................................................. ...................... 59 4.5.3 leds.................................................................................................................... ....................... 62 4.5.4 serial communication .................................................................................................... ............ 63 4.5.5 a/d converter inputs (op7200 only) ...................................................................................... .. 65 4.5.6 graphic display functions ............................................................................................... .......... 75 4.5.7 keypad functions........................................................................................................ ............... 96 4.6 touchscreen (op7200 only)................................................................................................. .............. 99 4.7 rabbitnet port............................................................................................................ ...................... 111 chapter 5. using the tcp/ip features 113 5.1 tcp/ip connections ........................................................................................................ ................. 113 5.2 tcp/ip sample programs.................................................................................................... ............. 115 5.2.1 how to set ip addresses in the sample programs................................................................... 115 5.2.2 how to set up your computer for direct connect ................................................................. 116 5.2.3 run the pingme.c demo................................................................................................... .... 117 5.2.4 running more demo programs with a direct connection ..................................................... 118 5.3 where do i go from here? .................................................................................................. ........... 119 chapter 6. installation, mounting, and care guidelines 121 6.1 grounding................................................................................................................. ........................ 121 6.2 installation guidelines................................................................................................... ................... 122 6.3 mounting instructions ..................................................................................................... ................. 123 6.3.1 bezel-mount installation ................................................................................................ .......... 123 6.4 care guidelines ........................................................................................................... ..................... 125 appendix a. specifications 127 a.1 electrical and mechanical specifications.................................................................................. ...... 128 a.1.1 physical mounting....................................................................................................... ............ 130 a.2 conformal coating ......................................................................................................... ................. 131 a.3 jumper configurations ..................................................................................................... ............... 132 a.4 use of rabbit 2000 parallel ports ......................................................................................... .......... 135 a.5 i/o address assignments................................................................................................... ............. 137
user?s manual appendix b. power supply 139 b.1 power supplies............................................................................................................ .....................139 b.1.1 power for analog circuits............................................................................................... .........140 b.1.2 grounds ................................................................................................................. ...................140 b.1.3 rabbitnet power supplies................................................................................................ ........140 b.2 batteries and external battery connections ................................................................................ ....141 b.2.1 replacing the backup battery............................................................................................ ......141 b.2.2 external battery........................................................................................................ ................142 b.2.3 battery-backup circuit.................................................................................................. ...........143 b.2.4 power to vram switch.................................................................................................... .......144 b.2.5 reset generator ......................................................................................................... ...............144 b.3 chip select circuit ....................................................................................................... ....................145 appendix c. demonstration board connections 147 c.1 connecting demonstration board............................................................................................ ........147 appendix d. rabbitnet 151 d.1 general rabbitnet description............................................................................................. ...........151 d.1.1 rabbitnet connections ................................................................................................... .........151 d.1.2 rabbitnet peripheral cards.............................................................................................. ........152 d.2 physical implementation................................................................................................... ...............153 d.2.1 control and routing..................................................................................................... ............153 d.3 function calls ............................................................................................................ ......................154 d.3.1 status byte ............................................................................................................. ..................160 index 161 schematics 165
edisplay (op7200)
user?s manual 1 1. i ntroduction the op7200 intelligent operator interface is a small, high- performance, c-programmable da ta acquisition and display unit that offers built-in i/o, ethernet connectivity, and an optional touchscreen. the op7200 can be us ed in a control system with rabbitnet? expansion i/o cards. a rabbit ? 2000 microprocessor operating at 22.1 mhz provides fast data processing. the op7200 is designed for panel mounting and is nema-4 compatible. the op7200 incorporates the powerful rabbit 2000 microprocessor, flash memory, static ram, industrialized digi- tal i/o ports, rs-232/rs-485 serial ports, a 10/100-compatible ethernet port, and eight optional a/d converter inputs and touchscreen. 1.1 features ? small size: 4.4" 5.7" 1.7" (112 mm 144 mm 43 mm).  ? vga lcm display (320 240 pixels) with white led backlight.  software-controlled lcd contrast and backlight on/off.  9-key keypad.  lcd controller and sram compatible with op7100.  4 status leds.  24 digital i/o: 16 filtered digital inputs w ith an input range of 36 v dc and a switch- ing point of 2.4 v, and 8 sourcing/sinking/ tristate high-current outputs (250/350/0 ma).  rabbit 2000 microprocessor operating at 22.1 mhz.  audible alarm buzzer.  128k static ram and 256k flash memory standard.  one rj-45 10/100-compatible ethernet port with a 10base-t ethernet interface.
2 edisplay (op7200)  four serial ports (2 rs-232 or 1 rs- 232 with rts/cts, 1 rs-485 or rabbitnet? expansion port, and 1 cmos-c ompatible programming port).  onboard backup battery for real-time clock and sram, connection point for external battery included.  watchdog.  external reset input.  meets nema 4 watertightness specifi cations when front-panel mounted.  optional 8-channel 12-bit a/d converter.  optional 4096 4096 analog touchscreen. two op7200 models are available. their standard features are summarized in table 1. additional 512k flash/512k sram memory options are available for custom orders involving nominal lead times. contact your rabbit sales representative or authorized distributor for more information. throughout this manual, the term op7200 refers to the complete series of op7200 opera- tor interfaces unless other production models are referred to specifically. appendix a provides detailed specifications. table 1. op7200 models feature op7200 op7210 microprocessor rabbit 2000 running at 22.1 mhz static ram 128k flash memory 256k rj-45 ethernet connector and filter capacitors yes rabbitcore module used rcm2200 a/d converter inputs yes no 4096 4096 touchscreen yes no visit our web site for up-to-date information about a dditional add-ons and features as they become available. the web site also ha s the latest revision of this user?s manual.
user?s manual 3 1.2 development and evaluation tools 1.2.1 tool kit a tool kit contains the hardware essentia ls you will need to use your op7200. the items in the tool kit and their use are as follows.  op7200 getting started instructions.  dynamic c cd-rom, with complete product documentation on disk.  programming cable, used to connect your pc serial port to the op7200.  universal ac adapter, 12 v dc, 1 a (inc ludes canada/japan/u .s., australia/n.z., u.k., and european style plugs).  demonstration board with pushbutton switches and leds. the demonstration board can be hooked up to the op7200 to demonstrate the i/o.  wire assembly to connect demonstration board to op7200.  screwdriver.  rabbit 2000 processor easy reference poster.  registration card. figure 1. op7200 tool kit    
          rabbit and dynamic c are registered trademarks of digi international inc. edisplay (op7200) the op7200 intelligent operator interface is a small, high-performance, c-programmable data acquisition and display unit that offers built-in i/o, ethernet connectivity, and an optional touchscreen. these getting started instructions included with the tool kit will help you get your op7200 up and running so that you can run the sample programs to explore its capabilities and develop your own applications. tool kit contents the op7200 tool kit contains the following items: ? dynamic c cd-rom, with complete product documentation on disk. ? demonstration board with pushbutton switches and leds. ? wire assembly to connect demonstration board to op7200. ? programming cable, used to connect your pc serial port to the op7200. ? universal ac adapter, 12 v dc, 1 a (includes canada/japan/u.s., australia/n.z., u.k., and european style plugs). ? screwdriver. ? getting started instructions. ? rabbit 2000 processor easy reference poster. ? registration card. visit our online rabbit store at www.rabbit.com/store/ for the latest information on peripherals and acces- sories that are available for the op7200 operator interface. step 1 ? install dynamic c ? before doing any development, you must install dynamic c. insert the cd from the tool kit in your pc?s cd-rom drive. if the installation does not auto-start, run the setup.exe program in the root directory of the dynamic c cd. install any dynamic c modules after you install dynamic c .                     
                        
                         
       
   
               
      
       
4 edisplay (op7200) 1.2.2 software the op7200 is programmed using version 7.30 or later of rabbit?s dynamic c. a compat- ible version is included on the tool kit cd-rom. dynamic c v. 9.60 includes the popular c/os-ii real-time operating system, point-to-poi nt protocol (ppp), fat file system, rabbit- web, and other select libraries that were pr eviously sold as individual dynamic c modules. rabbit also offers for purchase the rabbit em bedded security pack featuring the secure sockets layer (ssl) and a specific advanced encryption standard (aes) library. in addi- tion to the web-based technical support incl uded at no extra charge, a one-year telephone- based technical support subscription is also av ailable for purchase. visit our web site at www.rabbit.com for further information and complete documentation, or contact your rabbit sales representative or authorized distributor.
user?s manual 5 1.3 rabbitnet peripheral cards rabbitnet? is an spi serial protocol that uses a robust rs-422 differential signalling inter- face (twisted-pair differential signaling) to run at a fast 1 megabit per second serial rate. the op7200 has one rabbitnet port, which can support one peripheral card. distances between a master processor unit and peripheral cards can be up to 10 m or 33 ft. the following low-cost peripheral cards are currently available.  digital i/o  a/d converter  d/a converter  display/keypad interface  relay card appendix d provides additional information on rabbitnet peripheral cards and the rabbit- net protocol. visit our web site for up-to-date information about additional add-ons and fea- tures as they become available.
6 edisplay (op7200) 1.4 ce compliance equipment is generally divided into two classes. these limits apply over the range of 30?230 mhz. the limits are 7 db higher for frequencies above 230 mhz. although the test range goes to 1 ghz, the emissions from rabbit-based systems at frequencies above 300 mhz are ge nerally well below background noise levels. the op7200 has been tested and was found to be in conformity with the following applicable immunity and emission standards. the op7210 is also ce qualified as it is a sub-version of the op7200. boards that are ce-compliant have the ce mark. note: earlier versions of the op7200 sold before 2003 that do not have the ce mark are not ce-compliant. immunity the op7200 operator control panels meet the following en55024/1998 immunity stan- dards.  en61000-4-2 (esd)  en61000-4-3 (radiated immunity)  en61000-4-4 (eft)  en61000-4-6 (conducted immunity) additional shielding or filtering may be re quired for a heavy industrial environment. emissions the op7200 operator control panels meet the following emission standards emission stan- dards with the rabbit 2000 spectrum spreader turned on and set to the normal mode. the spectrum spreader is only available with re v. c or higher of the rabbit 2000 microproces- sor. this microprocessor is used on the op7200 operator control panels that carry the ce mark.  en55022:1998 class b  fcc part 15 class b your results may vary, depending on your appli cation, so additional shielding or filtering may be needed to maintain the class b emission qualification. class a class b digital equipment meant for light industrial use digital equipment meant for home use less restrictive emissions requirement: less than 40 db v/m at 10 m (40 db relative to 1 v/m) or 300 v/m more restrictive emissions requirement: 30 db v/m at 10 m or 100 v/m
user?s manual 7 1.4.1 design guidelines note the following requirements for incor porating the op7200 operator control panels into your application to comply with ce requirements. general  the power supply provided with the tool kit is for development purposes only. it is the customer?s responsibility to provide a ce-c ompliant power supply for the end-product application.  when connecting the op7200 to outdoor cables, the customer is responsible for provid- ing ce-approved surge/lightning protection.  rabbit recommends placing digital i/o or analog cables that are 3 m or longer in a metal conduit to assist in maintaining ce compliance and to conform to good cable design practices. rabbit also recommends using properly shielded i/o cables in noisy electromagnetic environments.  while the op7200 meets the en61000-4-2 (esd) requirements in that it can withstand contact discharges of 4 kv and air discharges of 8 kv, it is the responsibility of the end-user to use proper esd precautions to prevent esd damage wh en installing or ser- vicing the op7200.  to meet electromagnetic compatibility require ments, and in particular to prevent mis- operation or damage from electr ostatic discharges, connect the bezel to a protective ground via a low-impedance path as explained in section 6.1. safety  for personal safety, all inputs and output s to and from the op7200 must not be con- nected to voltages exceeding selv levels (42.4 v ac peak, or 60 v dc). damage to the rabbit 2000 microprocessor may result if voltages outside the design range of 0 v to 5.5 v dc are applied directly to any of its digital inputs.  the lithium backup battery circuit on the op 7200 has been designed to protect the bat- tery from hazardous conditions such as reve rse charging and excessive current flows. do not disable the safety features of the design. 1.4.2 interfacing the op7200 to other devices since the op7200 operator control panels are de signed to be connected to other devices, good emc practices should be followed to ensu re compliance. ce compliance is ulti- mately the responsibility of the integrator . additional information, tips, and technical assistance are available from your authorized rabbit distributor, and are also available on our web site at www.rabbit.com .
8 edisplay (op7200)
user?s manual 9 2. g etting s tarted chapter 2 explains how to co nnect the programming cable and power supply to the op7200.
10 edisplay (op7200) 2.1 power supply connections 1. first prepare the ac adapter for the country where it will be used by selecting the plug. the op7200 tool kit presently includes canada/japan/u.s., australia/n.z., u.k., and european style plugs. snap in the top of the pl ug assembly into the slot at the top of the ac adapter as shown in figure 2, then press down on the spring-loaded clip below the plug assembly to allow the plug assembly to click into place. connect the bare ends of the power supply to the +pwr and -pwr positions on pins 1 and 2 of screw terminal header j3 as s hown in figure 2. the polarity of your connec- tions is not important because the power-suppl y circuit has a full-wave bridge rectifier. figure 2. power supply connections 2. apply power. plug in the ac adapter. if you are using your own power supply, it must provide 9 v to 40 v dc or 24 v ac?voltages outside this range could damage the op7200. caution: unplug the power supply while you make or otherwise work with the connections to the screw-terminal headers. this will protect your op7200 from inadvertent shorts or power spikes. note: a hardware reset is done by unplugging the ac adapter, then plugging it back in. you may also reset the op7200 by grounding the reset input located on pin 5 of screw-terminal header j10.    







 
 
 
 
 


 







                                  


 







             !    "                    


 







                                            #   #                                                    $              
         #   %&&'() 
                   
              '*+,'
-.+&
/+,'(0 12-'(&
&%3
12&+
-.+& 2%4
4.56
12&+
4.%/'    
  
user?s manual 11 2.2 demonstration program on power-up a repeating sequence of graphics and menus w ill be displayed on the lcd when power is first applied to the op7200. press any of the five keypad buttons immediately below the lcd to select the corresponding demonstration. when you are in a menu demo screen, press the diamond-shaped keypad button in the middle row to enter the menu choice that is highlighted, or press the up and down ke ys above and below the diamond-shaped key- pad button to move around the menu. note that the programming cable should not be connected for this demonstration. this demonstration will be replaced by a new program when the programming cable is attached and the new program is compiled a nd run. the demonstration is available for future reference in the dynamic c samples\op7200 directory as fun.c .
12 edisplay (op7200) 2.3 programming cable connections connect the programming cable to download pr ograms from your pc and to program and debug the op7200. note: use only the programming cable that has a red shrink wrap around the rs-232 level converter (part no. 101-0513), which is supplied with the op7200 tool kit. other rabbit programming cables might not be voltage-compatible or their connector sizes may be different. connect the 10-pin prog connector of the programming cable to header j1 on the op7200?s rabbitcore module. ensure that the colored edge lines up with pin 1 as shown. (do not use the diag connector, which is us ed for monitoring only.) connect the other end of the programming cable to a com port on your pc. make a note of the port to which you connect the cable, as dynamic c will need to have this parame ter configured. note that com1 on the pc is the default com port used by dynamic c. figure 3. programming cable connections note: some pcs now come equipped only with a usb port. it may be possible to use an rs-232/usb converter (part no. 20-151-0178) with the programming cable supplied with the op7200 tool kit. note that not all rs-232/usb converters work with dynamic c.       


   




 

 




 

 




 


  


  



  

  



    



  


  


   


   



  


  


  




  



   


   


                                                     



  


   

   


   



  



  


  



  


   



  


                          !        "                         



 







 




 




 



  



 




 




  


  




                                                                              #   #                                                                        $                                     # %&&'()                       !   " " " "      #             !          "          !                        " !"# $   %     
            
                
+ 

4+(& +.+('7
'76'     '7 -8(129
:(%4 &
','(
71-/+22'/&
&8'
4(+6(%**126
/%3.' 3)
45..126
+2
&8'
(133+2
/%3.';
%('<5..)
45..
+2 &8'
/+22'/&+(
&+
('*+,'
1&
<(+*
&8'
8'%7'(;
user?s manual 13 2.4 installing dynamic c if you have not yet installed dynamic c vers ion 7.30 (or a later version), do so now by inserting the dynamic c cd from the op7200 t ool kit in your pc?s cd-rom drive. the cd will auto-install unless you have disabled auto-install on your pc. if the cd does not auto-install, click start > run from the windows start button and browse for the dynamic c setup.exe file on your cd drive. click ok to begin the installation once you have selected the setup.exe file. the online documentation is installed along with dynamic c, and an icon for the docu- mentation menu is placed on the workstation?s desktop. double-click this icon to reach the menu. if the icon is missing, create a new desktop icon that points to default.htm in the docs folder, found in the dynamic c installation folder. the latest versions of all documents are al ways available for free, unregistered download from our web sites as well. the dynamic c user?s manual provides detailed instructions for the installation of dynamic c and any future upgrades. note: if you have an earlier version of dynamic c already installed, the default instal- lation of the later version will be in a different folder, and a separate icon will appear on your desktop. 2.5 starting dynamic c once the op7200 is connected to your pc and to a power source, start dynamic c by double-clicking the dynamic c icon on your desktop or in your start menu. dynamic c uses the serial port specified during installation if you are using a usb port to connect your pc to the op7200, choose options > project options and check ?use usb to serial converter? in ?serial options? on the communi- cations tab. click ok to save the settings. dynamic c assumes, by defaul t, that you are using serial port com1 on your pc when you are running a program. if you are using com1, then dynamic c should detect the op7200 and go through a sequence of steps to cold-boot the op7200 and to compile the bios. if the error message ?rabbit processo r not detected? appears, you have probably connected to a different pc serial port such as com2, com3, or com4. you can change the serial port used by dynamic c with the options menu, then try to get dynamic c to recognize the op7200 by selecting reset target/compile bios on the compile menu or by pressing . try the different com ports in the options menu until you find the one you are connected to. if you still can?t get dynamic c to recognize the target on any port, then the hookup may be wrong or th e com port might not working on your pc. if you receive the ?bios successfully compiled ?? message after pressing or starting dynamic c, and this message is followed by a communications error message, it is possible that your pc cannot handle th e 115,200 bps baud rate. try changing the baud rate to 57,600 bps as follows.  locate the serial options dialog in the dynamic c options > communications menu. change the baud rate to 57,600 bps.
14 edisplay (op7200) 2.6 pong.c you are now ready to test your set-up by running a sample program. find the file pong.c , which is in the dynamic c samples folder. to run the program, open it with the file menu (if it is not still open), then compile and run it by pressing f9 or by selecting run in the run menu. the stdio window will open on the pc and will dis- play a small square bouncing around in a box. this program shows that the cpu is working. the sample program described in section 5.2.3, ?run the pingme.c demo,? tests the tcp/ip portion of the board. 2.7 where do i go from here? note: if you purchased your op7200 through a distributor or rabbit partner, contact the distributor or partner first for technical support. if there are any problems at this point:  use the dynamic c help menu to get further assistance with dynamic c.  check the rabbit technical bulletin board and forums at www.rabbit.com/support/bb/ and at www.rabbit.com/forums/ .  use the technical support e-mail form at www.rabbit.com/support/ . if the sample program ran fine, you are now ready to go on to explore other op7200 fea- tures and develop your own applications. the following sample programs illustrate the features and operation of the op7200. these sample programs can be used as templates for applications you may wish to develop. chapter 3, ?subsystems,? provides a descri ption of the op7200?s features, chapter 4, ?software,? describes the dynamic c software libraries and introduc es some sample pro- grams. chapter 5, ?using the tcp/ip feat ures,? explains the tcp/ip features. basic keypad touchscreen bufflock.c contrast.c primitives.c scrolling.c text.c kp_16key.lib kp_analog.c kp_basic.c kp_menu.c btn_16key.c btn_basics.c btn_keyboard.c cal_touchscreen.c rd_touchscreen.c
user?s manual 15 2.8 remove battery tab the backup battery on the op7200 has a plastic ta b to protect the battery against discharg- ing before the op7200 is placed into service. although the battery is located inside the op7200?s protective casing, it is possible to reac h the plastic tab using pliers or tweezers from the opening on the side of the op7200 shown in figure 4. figure 4. remove battery tab note: rabbit recommends that the battery tab not be removed until you are ready to place the op7200 in normal service with regular power connected to header j3. the backup battery protects the contents of the sram and keeps the real-time clock running when regular power to the op7200 is interrupted. if you plan to use the real-time clock functionality in your application, you w ill need to set the real-time clock once you remove the plastic tab. set the real-time cloc k using the onscreen prompts in the demon- stration program. alternatively, you ma y set the real-time clock using the setrtckb.c sample program from the dynamic c samples\rtclock folder. the rtc_test.c sample program in the dynamic c samples\rtclock folder provides additional exam- ples of how to read and set the real-time clock.     
  

 

 
 
 
 
 
  
  
    
 
  
  
  
  
  
  
  
  
  
                                                   
 
  
   
  
 
 
  
  
  
 
                        !        "                      
 

 
 
 
 

 
 
  
                                                                          #   #                                                                      $                                    #  %&&'()                    !   " " " "      #            !         "          !                        " !"# $  %     
            !! !"# ' "( 
              
16 edisplay (op7200)
user?s manual 17 3. s ubsystems chapter 3 describes the principal subsystems for the op7200. ?digital i/o ? analog features (op7200 only) ? serial communication ? memory ? liquid crystal display controller ? keypad ? op7200 cpld figure 5 shows these rabbit-based s ubsystems designed into the op7200. figure 5. op7200 subsystems the memory and microprocessor are located on the rabbitcore module. the rcm2200 module is used on the op7200. if you have more than one op7200 or other rabbit products built around rabbitcore modules, take care not to swap the rabbitcore modules since they contain system id block inform ation and calibration constants that are unique to the board they were originally installed on. it is a good idea to save the calibration constants should you need to replace a rabbitcore module in the future. see section 4.3.8, ?using system information from the rabbitcore module,? for more information.  $) % !"#$ %*+ ,#' -*+ ,#' 
     ! "###  ./0 1 ,2) ) 3 "! 4 3 "!   4 )5"' ,  16"7 ,'$ #') , ),!!)
18 edisplay (op7200) 3.1 op7200 pinouts the op7200 pinouts are shown in figure 6. figure 6. op7200 pinouts note: screw-terminal header j2 and the associated analog and digital i/o are not avail- able on the op7210. 3.1.1 headers and screw terminals standard op7200 models are equi pped with four 1 12 screw terminal strips (j2, j3, j6, and j10), and a 2 5 programming header and an rj-45 ethernet jack on the rcm2200 rabbitcore module. the rj-45 jack labeled rabbitnet is a serial i/o expansion port for use with rabbitnet i/o cards. the rabbitnet jack does not support ethernet connections. be careful to connect your ethernet cable to the jack labeled ethernet .  " " " " " " " "  => >                                     $%        &   
'   ("%"    ) *  +  (,-.      $/# $" $0 %&&'()                  !   " " " "      #         !       "          !                        " !"# $  %
user?s manual 19 3.2 indicators 3.2.1 leds the op7200 has two leds, power good and microprocessor bad . the green power good led at ds2 indicates when power is applied to the op7200 and that vcc is within the proper operating range of 4.5 to 5.5 v. the led turns off when the op7200 is being reset. the red microprocessor bad led at ds1 indicates the status of the op7200. following reset, ds1 will be on and will remain on until turned off by dynamic c. once the microprocessor comes out of reset and finishes all its internal checks and initializes the system, it should turn ds1 off. the operation of ds1 may be redefined in any manner desired with the caveat that ds1 comes on after reset. the usr label on the dust cover refers to the led at ds1 and reflects its secondary purpose as a user-defined indicator. 3.2.2 buzzer an audible buzzer is turned on and off through the use of a programmed i/o bit defined in software.
20 edisplay (op7200) 3.3 digital i/o 3.3.1 digital inputs the op7200 has 19 digital inputs, in0?in18, each of which is protected over a range of ?36 v to +36 v. the inputs are factory-configur ed to be pulled up to +5 v, but they can also be pulled down to 0 v in banks of eight by changing a surface-mounted 0 ? resistor. figure 7 shows a sample digital input circui t. all 19 inputs are protected against noise spikes by a low-pass filter composed of a 22 k ? series resistor and a 10 nf capacitor. figure 7. op7200 digital inputs [pulled up?factory default] op7200 series boards can be made to order in volume with the banks of digital inputs pulled down to 0 v. contact your authorized rabbit distributor or your rabbit sales representative for more information. for in0?in7 the actual switching point between a zero and a one is 1.5 v max and 3.5 v min respectively. the range between 1.5 and 3.5 v is undefined. for in8?in15 the actual switching point between a zero and a one is 0.8 v max and 2.0 v min respectively. the range between 0.8 and 2.0 v is undefined. fo r in16?in17, which are available only on the op7200 model, the actual switching point between a zero and a one is 0.8 v max and 3.5 v min respectively. the range between 0.8 v and 3.5 v is undefined. therefore, the input voltage must be less than 0.8 v for all the digital inputs as a group to ensure that a zero is being read, and the input voltage must be must be greater than 3.5 v for a one. in16?in18 interface to the a/d converter chip serially with an access time of 100 s, which is different from the access time of 5 s for in0?in15, which interface in parallel with the rabbit 2000 microprocessor. 
2?
9 
9  "((  8 %'),),'##,) 1)  2  $//  
 
user?s manual 21 the digital inputs are each fully protected ove r a range of -36 v to +36 v, and can handle short spikes of 40 v. figure 8. op7200 digital input protected range 
$  
$  ;
$ 
$ '   3   4   5  4  4 
22 edisplay (op7200) 3.3.2 digital outputs the op7200 has eight digital outputs, out0? out7, which are individually configurable with the digoutconfig or digouttristateconfig software function calls as sinking (up to 350 ma per channel) or as sourcing (up to 250 ma per channel). figure 9 shows a wiring diagram for using the digital outputs in a sinking or a souring configuration. figure 9. op7200 digital outputs all the digital outputs are in the high-impedance tristate when the op7200 is initially powered on or reset. the cpld (u4) then enables either the sink control or the source control to operate the digital outputs as sinking or sourcing, and thereby serves as a hard- ware block to prevent both sinking and sourci ng drivers from being activated at the same time in a given channel. although the components are not installed, there is provision on the circuit board for the dig- ital outputs to be pulled as a group to vcc, +k, or to gnd through 27 k ? resistors. in spe- cial circumstances, you may need to pull si nking outputs high to either vcc or +k, or you may need to pull sourcing outputs to gnd, for example, when driving low-level logic sig- nals. pulling the digital outputs up to +k allows the current-sinking outputs to be used as voltage outputs where their upper level is controlled by the voltage of +k. op7200 series  '*'+!! + '+!!    1    1   4    4
     4

user?s manual 23 boards can be made to order in volume with th e digital outputs pulled up to vcc or +k, or pulled down to gnd. contact your authorized rabbit distributor or your rabbit sales rep- resentative for more information. +k is an externally supplied voltage of 9?40 v dc used primarily in combination with current sourcing outputs, and should be capable of delivering up to 2 a. although a con- nection to a +k supply is not absolutely required with sinking outputs, it is highly recom- mended to protect against current spikes when driving inductive loads. connect the positive +k supply to pin 3 of screw-terminal header j3 and the negative side of the supply to pin 12 of screw-terminal head er j3. exercise care to connect this supply correctly because the +k inputs are not protected against reverse polarity, and serious damage to the op7200 may result if you connect this supply backwards. when you are using the same dc power supply as the main power supply for the op7200 and as the +k power supply, rabbit recommends that you tie the -pwr connection to ground. since this step will bypass the reverse-polarity protection afforded by the full- wave bridge rectifier, ensure that the positive leads from the power supply are connected correctly to prevent damage to the op7200. figure 10. +k, power supply, and sample load connections    







 
 
 
 
 


 







   


 







 


 







     
                   
               (  , ' 5#3#"9 ,:)#!65,) ;"7 6* +22'/&'7
&+ 129126 5&45& +22'/&'7
&+ +5(/126 5&45& ,"7 ,"7  < )"! 6* ,:) !6   7" ) > => +22'/&'7
&+ 129126 5&45& +22'/&'7
&+ +5(/126 5&45& "   " ,"7 ,"7   
24 edisplay (op7200) 3.4 analog features (op7200 only) the single a/d converter used in the op7200 (the op7210 does not have analog or touch- screen capabilities) has a resolution of 11 bits (single-ended mode) or 12 bits (differential mode). there are eight channels of a/d conversion, and the op7200 also has provision for up to four digital inputs. three of the f our digital inputs are available on screw terminal header j2. the fourth digital input serves as a board status bit, and is controlled by a 0 ? surface-mount resistor r159. the factory defau lt is for r159 to not be installed, which leaves this fourth input pulled up to vcc. 3.4.1 a/d converter inputs figure 11 shows a pair of a/d converter input circuits. each a/d converter input consists of resistors and a capacitor. the resistors fo rm a10:1 attenuator, and the capacitor protects the a/d converter input agains t electrostatic discharges. figure 11. a/d converter inputs 
9    
$   1)  2  ;
$ 
 
9  
2? 
9  
9  
2? 
user?s manual 25 the a/d converter chip can make either single-ended or differential measurements depending on the value of the opmode parameter in the software function call. adjacent a/d converter inputs are paired to make diff erential measurements. the default setup for the op7200 is to measure only positive volta ges for the ranges listed in table 2. many other possible ranges are possible by physic ally changing the resistor values that make up the attenuator circuit. it is also possible to read a negative voltage by moving the 0 ? jumper (see figure 11) on header jp4, jp5, jp6, or jp7 associated with the a/d converter input from analog ground to the 2.048 v reference voltage generated a nd buffered by the a/d converter. adjacent input channels are paired so that moving a pa rticular jumper changes both of the paired channels. at the present time rabbit does not offer the software drivers to work with sin- gle-ended negative voltages, but the differen tial mode described be low may be used to measure negative voltages. differential measurements require two channels. as the name differential implies, the dif- ference in voltage between the two adjacent ch annels is measured rather than the differ- ence between the input and analog ground. vo ltage measurements taken in differential mode have a resolution of 12 bits, with the 12th bit indicating whether the difference is positive or negative. table 2. positive a/d converter input voltage ranges min. voltage (v) max. voltage (v) amplifier gain mv per tick 0.0 +20.0 1 10 0.0 +10.0 2 5 0.0 +5.0 4 2.5 0.0 +4.0 5 2.0 0.0 +2.5 8 1.25 0.0 +2.0 10 1.0 0.0 +1.25 16 0.625 0.0 +1.0 20 0.500
26 edisplay (op7200) the a/d converter chip can only accept positive voltages. when the 0 ? resistor shown in figure 11 ties the a/d attenuator circuit to analog ground, both differential inputs must be ref- erenced to analog ground, and both inputs must be positive with respect to analog ground . to make such differential measurements, move the 0 ? resistor jumper (see figure 11) associated with the a/d converter inputs (jp 4, jp5, jp6, or jp7) from analog ground to the 2.048 v reference voltage. this allows input voltages that are negative with respect to analog ground. table 3 provides the differential voltage ranges for this setup. if a device such as a battery is con- nected across two channels for a differential measurement, and it is not referenced to analog ground, then the current from the device will flow through both sets of attenuator resistors as shown in figure 12. this will generate a negative voltage at one of the inputs, ain1, which will almost certainly lead to inaccurate a/d conversions. figure 12. current flow from ungrounded or floating source table 3. differential voltage ranges min. differential voltage (v) max. differential voltage (v) amplifier gain mv per tick 0 20.0 1 10 0 10.0 2 5 0 5.0 4 2.5 0 4.0 5 2.0 0 2.5 8 1.25 0 2.0 10 1.00 0 1.25 16 0.625 0 1.0 20 0.500 
9  
9  
2? 
9  
9  
2?          = 
user?s manual 27 the input circuit of the op7200 was designed to use the differential mode in a unique way to support measuring voltages in an equa l range above and below ground. this method also requires you to move the 0 ? jumper (see figure 11) on the header associated with the a/d converter inputs (jp4, jp5, jp6, or jp 7) from analog ground to the 2.048 v reference voltage. the input is connected to the ev en-numbered channel, and the odd-numbered channel is tied to analog ground. table 4 provides the bipolar voltage ranges for this setup. 3.4.2 analog current measurements table 4. bipolar voltages min. voltage (v) max. voltage (v) amplifier gain mv per tick -20.0 +20.0 1 10 -10.0 +10.0 2 5 -5.0 +5.0 4 2.5 -4.0 +4.0 5 2.0 -2.5 +2.5 8 1.25 -2.0 +2.0 10 1.00 -1.25 +1.25 16 0.625 -1.0 +1.0 20 0.500 the a/d converter inputs can also be used with 4?20 ma current sources by measuring the resulting analog volt- age drop across a 100 ? 1% precision resistor placed between the analog input and analog ground as shown in figure 13. the single-ended scale of 0?2.56 v with a gain of 8 is used to get an a/d current conversion of 12.5 a/tick. figure 13. resistor for 4?20 ma current sources 
 @  
28 edisplay (op7200) 3.4.3 calibrating the a/d converter chip manufacturing tolerances for resistors, bias currents, offset voltages, gain, and the like introduce errors into the a/d conversions. id eally there would be a one-to-one straight- line relationship between the input voltage and the output of the a/d converter, and a graph of such a line would have a slope of 1 and would pass through the (0,0) coordinate. however, the errors arising from manufacturi ng tolerances introduce a deviation between the applied input voltage and the voltage that is output by the a/d converter. the actual plot of voltage in vs. the voltage out from a/ d converter is not actually a straight line. however, a straight line is a very good firs t-order approximation, a nd the calibration rou- tines provided for the op7200 are based on a straight line with a slope of 1 and an offset from (0,0). the calibration routines use two known measurement points on the voltage-in vs. voltage-out line as the basis to calculate cali bration constants that will be used to adjust for the slope of the line and the offset from (0,0). the calibration routines typically use input voltage points that are 10% less then the maximum and 10% more than the mini- mum readings possible for the a/d converter on any given range. quality calibration procedures are extremel y important in obtaining good a/d converter results. no matter how high a resolution the a/ d converter has, it cannot compensate for improper calibration. a/d converter results will never be more accurate than the meter used in the calibration process. therefore, use the best digital volt and milli-amp meter available that meets or exceeds the accuracy of the a/d converter chip. 3.4.3.1 modes the op7200 a/d converter operates in three different modes:  the single-ended mode,  the differential mode, and  the milli-amp mode the calibration and read routines provided correspond to these three modes. 3.4.3.2 calibration constants the a/d converter has eight individual input channels, and each channel has eight pro- grammable gains. additionally, the a/d convert er has the capability for adjacent inputs to be paired to make differential measuremen ts with eight different gains, and provision is also made to convert 4?20 ma analog current measurements.
user?s manual 29 to get the best results form the a/d converter , it is necessary to calibrate each mode for each of its gains. the following table provides a grid for each possible set of calibration constants. for the single-ended mode there are calibration constants for each channel and for each of its gains, for a total of 64 sets of calibratio n constants. the milli-amp mode covers 4?20 ma (actually 0?25 ma) currents. separate calibrati on and read-back routines are provided for this. since only one range of current measurem ent is provided, these routines use only one gain (4). one set of calibration constants is provided for each of the eight input channels. the differential-mode routines use a pair of input channels to make measurements. in this case, calibration constants are stored for each pair of channels and for each of the eight gains, for a total of 32 sets of calibration constants. when a calibration is performed, it fills in one of the squares in the table with a set of cal- ibration constants representing the corres ponding mode, channel, and gain. these con- stants are stored in flash memory, and are thus maintained even when power is been removed from the op7200. note that calibration constants are stored for each of the modes. since a/d converter read routines sele ct the appropriate calibration constants based on the mode, it is possible for software calls to move from one mode to another without recalibration. 3.4.3.3 calibration recommendations it is imperative that you calibrate each of the a/d converter inputs in the same manner as they are to be used in the application. for example, if you will be performing floating dif- ferential measurements or differential measurements using a common analog ground, then calibrate the a/d converter in the corresponding manner. the calibration must be done with the attenuator reference selection jumper in the desired position (see figure 11). if a mode single-ended ma differential gain code 1 2 4 5 8 10 16 20 4 1 2 4 5 8 10 16 20 input 0 1 2 3 4 5 6 7
30 edisplay (op7200) calibration is performed and the jumper is subsequently moved, the corresponding input(s) must be recalibrated. the calibration tabl e only holds calibration constants based on mode, channel, and gain. other factors affecting the calibration must be taken into account by calibrating using the same mode and gain setup as in the intended use. it is not necessary to fill out the entire calib ration table. only the entries associated with the modes, channels, and gains that you will be using are necessary. this fact can be used to simplify and speed up the calibration process. each calibration is normally done at 10% less than the maximum and 10% more than the minimum within a given voltage range define d by the mode, channel, and gain. however, if an application is known to use only portion of a particular range, it is possible to obtain improved accuracy by using calibration points th at are 10% less than the expected maxi- mum and 10% greater than the expected minimum. 3.4.3.4 factory calibration because of the large number of possible calibr ations, the factory performs only a rudimen- tary calibration on the unit. by default, all four of the attenuator reference selection jump- ers are in the analog ground position. the factory performs a single-ended calibration on each of the eight channels with a gain of 1 (0?20 v range). the remaining single-ended calibration constants for the other seven gain s are approximated and are filled in based on the initial calibration. the milli-amp and diff erential portions of the table are filled in using typical expected values. all read routin es will work properly with these factory-ini- tialized calibration constants, but only the singl e-ended mode should be expected to return accurate results over a range of 0?20 v until you recalibrate the op7200 for your use. sample programs are provided to illustrate how to read and calibrate the various a/d inputs for the three operating modes. these sample programs are found in the adc subdirectory in samples\op7200 . see section 4.3, ?sample programs,? for more information on these sample programs and how to use them. mode read calibrate single-ended, one channel adrd_se_ch.c adcal_se_ch.c single-ended, all channels adrd_se_all.c adcal_se_all.c milli-amp adrd_ma_ch.c adcal_ma_ch.c differential, analog ground adrd_diff_gnd.c adcal_diff_gnd.c differential, 2 v reference adrd_diff_2v.c adcal_diff_2v.c
user?s manual 31 3.4.4 touchscreen the op7200 analog touchscreen provides a high-resolution matrix of 4096 4096 elements. the touchscreen is mounted to the fr ont of and is the same size as the lcd mod- ule. a four-conductor flex cable connects the touchscreen to the op7200 at connector j13. the inputs from the touchscreen are protected from esd by ferrite beads, capacitors, and shunt diodes. the ferrite beads and capacitors also serve to eliminate emi radiating from the cable. ferrite beads rather than resistors are used in series with the inputs to maintain the most accurate measurement of the touchscreen x,y position. a reference voltage is applied across the t ouchscreen. when the touchscreen is touched, resistances that represent the x,y position are presented at the input circuit. the touchscreen controller chip u9 converts these resistances into digital form for use by the software. note: should you touch two or more different points on the touchscreen simultaneously, the resistance presented to the input circuit will represent some difference between the resistances corresponding to the points. this can lead to a different or an unknown key?s value being processed. to prevent this from happening, exercise care to ?touch? only one point or position on the touchscreen at a time. 3.4.5 analog supply voltage the analog section is isolated from digital noise generated by other components by way of a low-pass filter composed of l2, c31, and c32 as shown in the left side of figure 14. the +v analog power supply powers the a/d converter chip. figure 14. analog supply and voltage reference circuits  
2?  
 $  
  $- 
814 2&'(2%. '<'('2/' $+.&%6' " + 
+2,'(&'( $ $//   
2?  
2? #
32 edisplay (op7200) 3.4.6 a/d converter reference voltage (+v) a reference voltage of 2.048 v is generated by the a/d converter chip. the reference volt- age is used by the touchscreen controller chi p, and may also be used to bias the input attenuator circuits when bipolar inputs are to be measured. as shown in figure 14, the factory default is for a surface-mounted 0 ? resistor to connect pins 1?2 on header jp8. this enables the internal reference voltage of 2.048 v generated by the a/d converter chip. by connecting pins 2?3 on header jp8 instead, a ratiometric referenc e can be provided by the divider consisting of r148 and r150. a fixed reference can be configured by remov- ing r150 and installing a zener diode at u12. the zener diode will then set the reference voltage. c91 would be always installed, and provides filtering. none of these components (r148, r150, c91, or u12) is factory-installed.
user?s manual 33 3.5 serial communication the op7200 has two rs-232 serial ports, which can be configured as one rs-232 serial channel (with rts/cts) or as two rs-232 (3-wire) channels using the sermode software function call. table 5 summarizes the options. the op7200 also has one rs-485 serial channel and a cmos serial channel that serves as the programming port. when you are using th e op7200 in a rabbitnet network, serial port b is configured as a clocked serial por t and the rs-485 chip drives the rabbitnet port?the op7200 then cannot be used for rs-485 serial communication. all four serial ports operate in an asynchr onous mode up to the baud rate of the system clock divided by 32. an asynchronous port can ha ndle 7 or 8 data bits. a 9th bit address scheme, where an additional bit is sent to mark the first byte of a message, is also sup- ported. serial port a, the programming port, a nd serial port b can be operated alternately in the clocked serial mode. in this mode, a cl ock line synchronously clocks the data in or out. either of the two communicating device s can supply the clock. when the rabbit pro- vides the clock, the baud rate can be up to ? of the system clock frequency, or more than 5.525 mbps for a 22.1 mhz clock speed. the op7200 boards use all four serial ports. seri al port a is used in the clocked serial mode to provide cold-boot, download, and emul ation functions. serial port b is used either for rs-485 or for rabbitnet communica tion, and serial ports c and d are used for rs-232 communication. the op7200 uses an 11.0592 mhz crystal, which is doubled to 22.1184 mhz. at this frequency, the op7200 supports standard asynchronous baud rates up to a maximum of 230,400 bps. table 5. serial communication configurations software mode serial port b c d 0 rs-485 rs-232, 3-wire rs-232, 3-wire 1 rs-485 rs-232, 5-wire cts/rts 2 not initialized * * use modes 2 and 3 when serial port b is going to used by other libraries such as packet.lib . rs-232, 3-wire rs-232, 3-wire 3 not initialized * rs-232, 5-wire cts/rts
34 edisplay (op7200) 3.5.1 rs-232 the op7200 rs-232 serial communication is s upported by an rs-232 transceiver. this transceiver provides the voltage output, slew rate, and input voltage immunity required to meet the rs-232 serial communi cation protocol. basically, the chip translates the rabbit 2000?s cmos/ttl signals to rs-232 signal levels. note that the polarity is reversed in an rs-232 circuit so that a +5 v output becomes approximately -10 v and 0 v is output as +10 v. the rs-232 transceiver also provides the proper line loading for reliable commu- nication. rs-232 can be used effectively at the op7200?s maximum baud rate for distances of up to 15 m. if you are planning to use any of the rs-232 serial ports and the rabbitnet port on the op7200, initialize the serial port(s) before you initialize the rabbitnet port. section 4.5.4 provides some sample code to illustrates the sequence. 3.5.2 rs-485 the op7200 has one rs-485 serial channel, wh ich is connected to the rabbit 2000 serial port b through an rs-485 transceiver. the half-duplex communication uses an output from the cpld (u4) to control the transmit enable on the communication line. using this scheme a strict master/slave relationship must exist between devices to insure that no two devices attempt to drive the bus simultaneously. the op7200 can be used in an rs-485 multidrop network spanning up to 1200 m (4000 ft), and there can be as many as 32 attached devices. connect the 485+ to 485+ and 485? to 485? using single twisted-pair wires as show n in figure 15. note that a common ground is recommended. figure 15. op7200 multidrop network =   =   =  
user?s manual 35 the op7200 comes with a 220 ? termination resi stor and two 681 ? bias resistors installed and enabled with jumpers across pins 1?2 and 4?6 on header j8, as shown in figure 16. figure 16. rs-485 termination and bias resistors for best performance, the ter mination resistors in a multid rop network should be enabled only on the end nodes of the network, but not on the intervening nodes. jumpers on boards whose termination resistors are not enable d may be stored across pins 1?3 and 5?6 of header j8. note: remove the back cover from the op7200 to access the bias and termination resistor jumpers on header j8.      1)  2     







 
 
 
 
 


 







                                  


 







             !    "                    


 







                                            #   #                                                    $                      #  %&&'()                  !   " " " "      #         !       "          !                        " !"# $  %   
  
  
      

 "    
36 edisplay (op7200) 3.5.3 rabbitnet port the rj-45 jack labeled rabbitnet is a serial i/o expansion port for use with rabbitnet i/o cards. the rabbitnet jack does not support ethernet connections. there is also no provision for the op7200 to supply power to any rabbitnet peripheral cards. when you are using the op7200 in a rabbitnet network, serial port b is configured as a clocked serial port and the rs-485 chip drives the rabbitnet port?the op7200 then cannot be used for rs-485 serial communication. if you are planning to use any of the rs-232 serial ports and the rabbitnet port on the op7200, initialize the serial port(s) before you initialize the rabbitnet port. section 4.5.4 provides some sample code to illustrates the sequence. in principle, the op7200 can operate either as a master controller with rabbitnet expan- sion i/o, or it can operate as a slave opera tor interface in a rabbitnet network. jumper settings on header jp10 are used to configure the op7200 for master or slave operation as shown in appendix a.3, ?jumper configurations .? the factory default is for the op7200 to be configured as a rabbitnet master. at the present time, dynamic c does not support the operation of the op7200 as a slave, and so the op7200 is restricted to being used as a master. appendix d provides additional inform ation about the rabbitnet system.
user?s manual 37 3.5.4 ethernet port figure 17 shows the pinout for the ethernet port (j2 on the op7200?s rabbitcore module). note that there are two standards for numbering the pins on this connector?the convention used here, and numbering in reverse to that shown. regardless of the numbering conven- tion followed, the pin positions relative to the spring tab position (located at the bottom of the rj-45 jack in figure 17) are always absolute, and the rj-45 connector will work prop- erly with off-the-shelf ethernet cables. figure 17. rj-45 ethernet port pinout rj-45 pinouts are sometimes numbered opposite to the way shown in figure 17. two leds are placed next to the rj-45 ethernet jack, one to indicate a live ethernet link ( lnk ) and one to indicate ethernet activity ( act ). the transformer/connector assembly ground is connected to the op7200?s rabbitcore module printed circuit board digital ground via a 0 ? resistor ?jumper,? r29, as shown in figure 18. figure 18. isolation resistor r29 the factory default is for the 0 ? resistor ?jumper? at r29 to be installed. in high-noise environments, remove r29 and ground the tr ansformer/connector assembly directly through the chassis ground by using the egnd terminal on the rabbitcore module. this will be especially helpful to minimize esd and/or emi problems. a $(,.  ;
bc ;
bc ;
bc ;
bc   $(,.$4
      
38 edisplay (op7200) 3.5.5 programming port the rabbitcore module on the op7200 has a 10-pin programming header. the program- ming port uses the rabbit 2000?s serial port a for communication. dynamic c uses the programming port to downl oad and debug programs. the programming port is also used for the following operations.  cold-boot the rabbit 2000 on the rabbitcore module after a reset.  remotely download and debug a program ove r an ethernet connection using the rabbitlink eg2110.  fast copy designated portions of flash me mory from one rabbit-based board (the master) to another (the slave) using the rabbit cloning board. alternate uses of the serial programming port all three clocked serial port a signals are available as  a synchronous serial port  an asynchronous serial port, with the cl ock line usable as a general cmos input the serial programming port may also be used as a serial port via the diag connector on the serial programming cable. in addition to serial port a, the rabb it 2000 startup-mode (smode0, smode1), status, and reset pins are available on the serial programming port. the two startup mode pins determine what happens after a reset?the rabbit 2000 is either cold-booted or the program begins executing at address 0x0000. the status pin is used by dynamic c to determine whether a rabbit microprocessor is present. the status output has three different programmable functions: 1. it can be driven low on the first op code fetch cycle. 2. it can be driven low during an interrupt acknowledge cycle. 3. it can also serve as a general-purpose cmos output. the /reset_in pin is an external input that is used to reset the rabbit 2000 and the onboard peripheral circuits on the rabbitcore module. the serial programming port can be used to force a hard reset on the rabbitcor e module by asserting the /reset_in signal. the green power good led goes off momentarily during a reset. refer to the rabbit 2000 microprocessor user?s manual for more information.
user?s manual 39 3.6 memory 3.6.1 sram the op7200?s rabbitcore module is designed to accept 128k to 512k of sram pack- aged in an soic case. the standard op7200?s rabbitcore modules come with 128k of sram. 3.6.2 flash memory the op7200 is also designed to accept 128k to 512k of flash memory. the standard op7200?s rabbitcore modules comes with one 256k flash memory. note: rabbit recommends that any customer applications should not be constrained by the sector size of the flash memory since it may be necessary to change the sector size in the future. a flash memory bank select jumper configuration option based on 0 ? surface-mounted resistors exists at header jp2 on the rabbitc ore module. this option, used in conjunction with some configuration macros, allows dyna mic c to compile two different co-resident programs for the upper and lower halves of the 256k program flash in such a way that both programs start at logical address 0000. this is useful for applications that require a resident download manager a nd a separate downloaded program. see technical note 218, implementing a serial download manager for a 256k flash , for details.
40 edisplay (op7200) 3.7 liquid crystal display controller the lcd module controller chip provides s upport for the lcd module. the controller chip is attached to the data bus on the op7200?s rabbitcore module, and is mapped to the i/o address space. this interface is composed of eight data bits, one address line, and three control lines (/iord, /iowr, and /lcdm-cs). the interface from the lcd controller to the lcd module is unidirectional. data flow from the controller chip to the lcd module. a number of control lines are provided for this func- tion, but not all of them are used for a part icular lcd module. the controller continually reads the sram (which is included on the lcd controller chip used after january,2006) for data placed there by the microprocessor and refreshes the display periodically. other functions support the lcd module to adjust its contrast and to turn the white led backlight on and off. a variable resistor be tween two of the lcd module?s terminals sets the contrast. u5 is a digitally controlled poten tiometer that is controlled by software. once the value is set, the value will be maintaine d. a single programmed i/o bit is used to turn the led backlight on or off. since this bit does not have enough drive current to light the led directly, it is buffered by the fet q1. the controller chip used in op7200?s sold before 2006 supported either 32k or 64k of sram. these op7200s were designed using a dual-footprint sram to accept either one 32k or one 128k sram. the 128k part wa s standard. the full 64k supported by the controller is available with the 128k sram, plus an additional 64k can be swapped in and out by using the programmed i/o bit va1 6. pins 1?2 on header jp9 are normally con- nected by a 0 ? surface-mounted resistor, but pins 2?3 should be connected instead for video sram paging with i/o bit va16. op7200 units sold after january, 2006, have a new lcd controller chip because the previ- ously used lcd controller chip is no longer available. the new lcd controller chip has 32k of internal sram. figure 19 shows the area of the op7200 that changed to accommo- date the new lcd controller chip. the new lc d controller is not 100% code-compatible with the old chip?section 4.1.2.1 explains how to handle programs developed using versions of dynamic c before v. 9.40. figure 19. how to identify pre-2006 op7200 boards    







 
 
 
 
 
                             


 







            !    "       
                 #   #                                                    $              #                       







 
 
 
 
 
                             


 







             !    "       
                 #   #                                                    $           %&&'()                   #  %&&'() &("##0+7"## &'!+7"##
user?s manual 41 3.8 keypad the op7200 is equipped with a nine-position ke ypad. the keypad is attached to the front bezel with an adhesive backing and is connected through j16 to the op7200 printed- circuit board with a flex cable. only 7 of the 10 conductors in the cable are used at the present time. the extra lines are reserved fo r an expanded keypad or led indicators. the interface to the keypad is through programmed i/ o bits composed of four scan rows of three keys each. driving a particular scan line (/kb?s0:3) low will read back a zero on the keypad data lines (/pb0:2?k0:2) associated with the three keys on the selected row. diodes d16?d19 prevent feedback, allowing the software to read the keypad even when multiple keys are pressed simultaneously . resistors r138?r141 and capacitors c79?c81 and c83 form a low-pass filter to protect against esd damage. these same circuits help to eliminate emi from being radiated from the keypad or its flex cable. r149, r151?r152, and c82?c84 perform a similar function for the keypad data lines. the tri-state receiver chip u13 connects the key data to the micr oprocessor data bus at the appropriate time when directed by the control signals /ior d and /pe5-io-cs1. note that only the low- order three bits of the data bus are connected. the software must mask off the high 5 bits since they are undefined. figure 20 shows how the keypad is encoded w ith respect the scan and data lines. for example, if /kb?s2 is asserted low, then keys d, h, and e are read back on data lines k0, k1, and k2 respectively. a zero read on the data lines indicates that the key is pressed and a one indicates that it is not. ones are always read back on data lines that are not assigned to any particular key. once the values read from the keypad remain constant for a length of time, the read can be assumed to be valid. figure 20. op7200 keypad encoding     ? a         ?  a            
42 edisplay (op7200) 3.9 op7200 cpld all the random logic used to control the op7200 is contained within a single complex logic device (cpld). the amd atf1500a contains 32 macrocells and is packaged in a 44-pin tqfp. this device contains decoding a nd a number of i/o bits that can be set to high or low to control various functions of the op7200. the cpld interfaces to the address and data bus on the rabbitcore module, and is write- only. two chip select lines, /pe4 and /pe5, ar e used to enable the device. /pe4 and /pe5 are configured in software as i/o strobes, a nd set the base address used by the cpld. /pe4 is used when selecting one of the sixteen i/o control bits associated with the eight driver circuits. /pe5 is used with the remainder of the controls. the control bits within the cpld normally can be set and reset independently of one another. the sink and source out- puts are different in that both the sink and source outputs for a particular driver can- not be asserted simultaneously. if either the sink or source output is asserted, and the software tries to set the other, the operation is ignored and the bit will not be set. the pur- pose of this interlock is to prevent damage to the driver circuit by not allowing both cur- rent sourcing and sinking to be enabled simultaneously. table 6. cpld parameters /pe5 /pe4 a3?0 d0 signal function 1 0 0000 1 sink0 enable sink output 0 1 0 0000 0 sink0 disable sink output 0 1 0 0001 1 sink1 enable sink output 1 1 0 0001 0 sink1 disable sink output1 1 0 0010 1 sink2 enable sink output 2 1 0 0010 0 sink2 disable sink output 2 1 0 0011 1 sink3 enable sink output 3 1 0 0011 0 sink3 disable sink output 3 1 0 0100 1 sink4 enable sink output 4 1 0 0100 0 sink4 disable sink output 4 1 0 0101 1 sink5 enable sink output 5 1 0 0101 0 sink5 disable sink output 5 1 0 0110 1 sink6 enable sink output 6 1 0 0110 0 sink6 disable sink output 6 1 0 0111 1 sink7 enable sink output 7 1 0 0111 0 sink7 disable sink output 7 1 0 1000 1 source0 enable source output 0 1 0 1000 0 source0 disable source output 0 1 0 1001 1 source1 enable source output 1 1 0 1001 0 source1 disable source output 1 1 0 1010 1 source2 enable source output 2 1 0 1010 0 source2 disable source output 2
user?s manual 43 1 0 1011 1 source3 enable source output 3 1 0 1011 0 source3 disable source output 3 1 0 1100 1 source4 enable source output 4 1 0 1100 0 source4 disable source output 4 1 0 1101 1 source5 enable source output 5 1 0 1001 0 source5 disable source output 5 1 0 1110 1 source6 enable source output 6 1 0 1110 0 source6 disable source output 6 1 0 1111 1 source7 enable source output 7 1 0 1111 0 source7 disable source output 7 0 1 0000 1 /kb-s0 assert keypad scan line s0 0 1 0000 0 /kb-s0 deassert keypad scan line s0 0 1 0001 1 /kb-s1 assert keypad scan line s1 0 1 0001 0 /kb-s1 deassert keypad scan line s1 0 1 0010 1 /kb-s2 assert keypad scan line s2 0 1 0010 0 /kb-s2 deassert keypad scan line s2 0 1 0011 1 /kb-s3 assert keypad scan line s3 0 1 0011 0 /kb-s3 deassert keypad scan line s3 0 1 0100 1 bklt-on turn on the lcdm backlight 0 1 0100 0 bklt-on turn off the lcdm backlight 0 1 0101 1 rs485-en enable the 485 transmitter 0 1 0101 0 rs485-en disable the 485 transmitter 0 1 0110 1 alarm turn on the buzzer 0 1 0110 0 alarm turn off the buzzer 0 1 0111 1 va 1 6 assert the va16 address line/rabbitnet cs 0 1 0111 0 va 1 6 deassert the va16 address line/rabbitnet cs 0 1 1000 1 /cs assert x9015 chip select 0 1 1000 0 /cs deassert x9015 chip select 0 1 1001 1 u_d set x9015 to count up 0 1 1001 0 u_d set x9015 to count down 0 1 1010 * inc increment the x9015 counter 0 1 1011 * na reserved 0 1 1100 * na reserved 0 1 1101 * na reserved 0 1 1110 * na reserved 0 1 1111 * na reserved table 6. cpld parameters (continued) /pe5 /pe4 a3?0 d0 signal function
44 edisplay (op7200) 3.10 programming cable the programming cable is used to connect the programming port of the rabbitcore module to a pc serial com port. the programming ca ble converts the rs-232 voltage levels used by the pc serial port to the ttl voltage levels used by the rabbit 2000. when the prog connector on the programming cable is connected to the rabbitcore module?s programming header, programs can be downloaded and debugged over the serial interface. the diag connector of the programming cable may be used on the programming header of the rabbitcore module with the module operating in the run mode. this allows the pro- gramming port to be used as a regular serial port. 3.10.1 changing between program mode and run mode the op7200 is automatically in program mode when the prog connector on the pro- gramming cable is attached to the rabbitcore module, and is automatically in run mode when no programming cable is attached. when the rabbit 2000 is reset, the operating mode is determined by the status of the smode pins. when the programming cable?s prog connector is attached, the smode pins are pulled high, placing the rabbit 2000 in the program mode. when the programming cable?s prog connector is not attached, the smode pins are pulled low, causing the rabbit 2000 to operate in the run mode. figure 21. op7200 program mode and run mode set-up a program can be run in either mode, but can only be downloaded and debugged when the op7200 is in the program mode. refer to the rabbit 2000 microprocessor user?s manual for more information on the pro- gramming port and the programming cable.     ;:$'$"339,7&  !!" "5 ))9,23,)" "'$3),3)"993'"(!=    







 
 
 
 
 


 







   


 







 


 







       







 
 
 
 
 


 







   


 







 


 







     
                   
               
                   
                +.+('7
'76' + 

4+(&  

user?s manual 45 3.11 other hardware 3.11.1 spectrum spreader op7200 operator control panels that carry th e ce mark on their rabbitcore module have a rabbit 2000 microprocessor that features a sp ectrum spreader, which helps to mitigate emi problems. by default, the spectrum sp reader is on automatically for op7200 operator control panels that carry the ce mark when used with dynamic c 7.30 or later versions, but the spectrum spreader may also be turned off or set to a stronger setting. the means for doing so is through a simple global macro as shown below. there is no spectrum spreader functionali ty for op7200 operator control panels that do not carry the ce mark on their rabbitcore module or when using any op7200 with a ver- sion of dynamic c prior to 7.30. 1. select the ?defines? tab from the dynamic c options > project options menu. 2. normal spreading is the default, and usually no entry is needed. if you need to specify normal spreading, add the line enable_spreader=1 for strong spreading, add the line enable_spreader=2 to disable the spectrum spreader, add the line enable_spreader=0 note: the strong spectrum-spreading setting is not needed for the op7200. 3. click ok to save the macro. the spectrum spreader will now remain off whenever you are in the project file where you defined the macro.
46 edisplay (op7200)
user?s manual 47 4. s oftware dynamic c is an integrated de velopment system for writing embedded software. it runs on an ibm-compatible pc and is designed for use with single-boa rd computers and other devices based on the rabbit microprocessor. chapter 4 provides the libraries, function calls, and sample pro- grams related to the op7200. 4.1 running dynamic c you have a choice of doing your software devel opment in the flash memory or in the static ram included on the op7200. the flash memory and sram options are selected with the options > compiler menu. the advantage of working in ram is to save wear on the flash memory, which is limited to about 100,000 write cycles. the disadvantage is that the code and data might not both fit in ram. note: an application can be developed in ram, but cannot run standalone from ram after the programming cable is disconnected. standalone applications can only run from flash memory. note: do not depend on the flash memory sector size or type. due to the volatility of the flash memory market, the op7200 and dynamic c were designed to accommodate flash devices with various sector sizes. op7200s that are special-ordered with 512k flash/512k sram memory options have two 256k flash memories. by default, dynamic c will use only the first flash memory for pro- gram code in these op7200s. uncomment the use_2ndflash_code macro within the rabbitbios.c file in the dynamic c bios folder to allow the second flash memory to hold any program code that is in excess of the available memory in the first flash.
48 edisplay (op7200) developing software with dynamic c is simple . users can write, compile, and test c and assembly code without leaving the dyna mic c development environment. debugging occurs while the application runs on the target . alternatively, users can compile a program to an image file for later loading. dynamic c runs on pcs under windows 98 or later. pro- grams can be downloaded at baud rates of up to 460,800 bps after the program compiles. dynamic c has a number of standard features.  full-feature source and/or assembly-level debugger, no in-circuit emulator required.  royalty-free tcp/ip stack with sour ce code and most common protocols.  hundreds of functions in source-c ode libraries and sample programs: x exceptionally fast support for floating-point arithmetic and transcendental functions. x rs-232 and rs-485 serial communication. x analog and digital i/o drivers. x i 2 c, spi, gps, file system. x lcd display and keypad drivers.  powerful language extensions for c ooperative or preemptive multitasking  loader utility program to load binary images into rabbit targets in the absence of dynamic c.  provision for customers to create their own s ource code libraries and augment on-line help by creating ?function description? bloc k comments using a special format for library functions.  standard debugging features: x breakpoints?set breakpoints that can disable interrupts. x single-stepping?step into or over functions at a source or machine code level, c/os-ii aware. x code disassembly?the disassembly window disp lays addresses, opcodes, mnemonics, and machine cycle times. switch between debugging at machine-code level and source-code level by simply opening or closing the disassembly window. x watch expressions?watch expressions are compiled when defined, so complex expressions including function calls may be placed into watch expressions. watch expressions can be updated with or without stopping program execution. x register window?all processor registers and flags are displayed. the contents of general registers may be modified in the window by the user. x stack window?shows the contents of the top of the stack. x hex memory dump?displays the contents of memory at any address. x stdio window? printf outputs to this window and keyboard input on the host pc can be detected for debugging purposes. printf output may also be sent to a serial port or file.
user?s manual 49 4.1.1 upgrading dynamic c 4.1.1.1 patches and bug fixes dynamic c patches that focus on bug fixes are available from time to time. check the web site www.rabbit.com/support/ for the latest patches, workarounds, and bug fixes. the default installation of a patch or bug fix is to install the file in a directory (folder) dif- ferent from that of the original dynamic c installation. rabbit recommends using a differ- ent directory so that you can verify the ope ration of the patch without overwriting the existing dynamic c installation. if you have made any changes to the bios or to libraries, or if you have programs in the old directory (folder), make these same changes to the bios or libraries in the new directory containing the patch. do not simply copy over an entire file since you may overwrite a bug fix; of course, you may c opy over any programs you have written. once you are sure the new pa tch works entirely to your satisfaction, you may retire the existing installation, but keep it available to handle legacy applications. 4.1.1.2 upgrades dynamic c installations are designed for use w ith the board they are included with, and are included at no charge as part of our low- cost kits. dynamic c is a complete software development system, but does not include all the dynamic c features. rabbit also offers add-on dynamic c modules containing the popular c/os-ii real-time operating system, as well as ppp, advanced encryption standard (aes), and other select libraries. in addi- tion to the web-based technical support incl uded at no extra charge, a one-year telephone- based technical support module is also available for purchase. note: dynamic c rabbitsys cannot be used with the op7200.
50 edisplay (op7200) 4.1.2 accessing and downloading dynamic c libraries the libraries needed to run the op7200 are available on the cd included with the devel- opment kit. upgrades may be downloaded from www.rabbit.com/support/downloads/ on our web site. you may need to download upgraded or additional libraries to run selected rabbitnet peripheral boards or to use an op7200 purchased after january, 2006, with a dynamic c release prior to v. 9.40. when downloading the libraries from the web site, click on the product-specific links until you reach the links for the op7200 download you require. you will be able to either run the download directly from the web site, or you may choose to save it to run later. once you run the download, installshield will in stall the additional or upgraded software. a readme file associated with the installation will then guide you to add to, replace, or edit dynamic c libraries or sample programs. you will be able to use the revamped dynamic c installation with the op7200 and you will continue to be able to use this upgraded installation with all the other rabbit products you were able to use before. 4.1.2.1 new lcd controller chip op7200 units sold after january, 2006, have a new lcd controller chip because the pre- viously used lcd controller chip is no longe r available. the new lcd controller is not 100% code-compatible with the old chip, and therefore changes were made to the lcd drivers. the updated drivers for the op7200 are included in dynamic c v. 9.40 and later, and are backward-compatible for use with the old lcd controller chip. if you are using a program developed with an earlier version of dynamic c, you will need to replace the existing dynamic c sed1335f.lib library in your dynamic c installa- tion in the lib\displays\graphic\320x240 folder. once you have the new sed1335f.lib library, you will have to recompile your program. the new sed1335f.lib library is available for download from our web site at www.rabbit.com/support/downloads/downloads_prod.shtml , and has been tested for compatibility with dynamic c versions 7.33 and later. the changes to the sed1335f.lib library will improve th e op7200 screen update time by a factor of four. otherwise, the form, fit, and function of the op7200 are not affected by the changes.
user?s manual 51 4.2 font and bitmap converter the font and bitmap converter is a utility included with dynamic c to convert windows fonts and monochrome bitmaps to a library file format compatible with dynamic c appli- cations and rabbit?s graphic displays. these library files may be added to applications with the statement #use libraryfilename.lib or by cutting and pasting from the library file directly into the application. remember to enter libraryfilename.lib into lib.dir , which is located in the dynamic c directory if you #use libraryfile- name.lib . to start the font and bitmap converter, use the windows start > run menu or windows explorer to launch fbmcnvtr.exe from the root folder where dynamic c is installed. click on help in the font and bitmap converter u tility to get complete use information about the utility.
52 edisplay (op7200) 4.3 sample programs sample programs are provided in the dynamic c samples folder. the sample program pong.c demonstrates the output to the stdio window. the various directories in the samples folder contain specific sample program s that illustrate the use of the correspond- ing dynamic c libraries. the samples\op7200 folder provides sample programs specific to the op7200. each sample program has comments th at describe the purpose and function of the program. fol- low the instructions at the beginning of the sample program. to run a sample program, open it with the file menu (if it is not still open), then compile and run it by pressing f9 or by selecting run in the run menu. the op7200 must be in program mode (see section 3.10) and must be connected to a pc using the programming cable as described in section 2.3. more complete information on dynamic c is provided in the dynamic c user?s manual . 4.3.1 general op7200 sample programs the following sample programs are found in the samples\op7200 directory.  board_id.c ?detects the model of the board you are using and displays the informa- tion in the stdio window.  fun.c ?demonstrates the features of the op7200. a variable customer-supplied 0?10 v dc power supply is recommended to de monstrate the analog input section. 4.3.2 digital i/o the following sample programs are found in the io subdirectory in samples\op7200 .  buzzer.c ?demonstrates the use of the op7200 buzzer.  digin.c ?demonstrates the use of the digital inputs. using the demonstration board, you can see an input channel toggle from high to low when pressing a pushbutton on the demonstration board.  digout.c ?demonstrates the use of the high-cu rrent outputs configured as either sinking or sourcing outputs. using the de monstration board, you can see an led toggle on/off via a high-current output.  led.c ?toggles the leds on the op7200.  pwm.c ?demonstrates the use of timer b to generate a 42 hz pwm signal on digital output out0. the pwm duty cycle may be adjusted from 1 to 99%. connect +k to +pwr (pins 1 and 3 on screw-terminal he ader j3) to run this sample program.  tristate.c ?demonstrates the use of the high-current outputs configured as sink- ing, sourcing, or tristate outputs. using the demonstration board, you can see a bank of channels toggle the corresponding leds on/off via the high-current outputs.
user?s manual 53 4.3.3 serial communication the following sample programs are found in the rs232 subdirectory in samples\op7200 .  puts.c ?this program transmits and then receives an ascii string on serial ports c and d. the serial data received are displayed in the stdio window. to set up the op7200, you will need to tie txc and rxd together on the screw-terminal header at j10, and you will also tie txd and rxc together as shown in the diagram.  relaychr.c ?this program echoes charac- ters to or from a serial utility such as hyper- terminal or tera term. to set up the op7200, you will need to tie txc and rxd together on the screw-terminal header at j10. set up hyperterminal or tera term as follows: 19200 bps, 8 data bits, no parity, 1 stop bit, and no flow control. here are a few additional settings if you are using tera term. x disable local echo in the terminal setup x enable the receive and line feed options ( cr + lf ) under new line in the terminal setup now when you type characters in the hyperterminal or tera term window, they will appear in the window because they are being echoed back by the sample program. two sample programs, master.c and slave.c , are available in the rs485 subdirectory in samples\op7200 to illustrate rs-485 master/s lave communication. to run these sample programs, you will need a second rabbit-based system with rs-485?another rabbit single-board computer or op7200 may be used as long as you use the master or slave sample program associated with that board. the rs-485 connections between the slav e and master devices are as follows. ? rs485+ to rs485+ ? rs485? to rs485? ? gnd to gnd then connect your pc com port to screw-terminal header j10 as follows. x pc tx to rxc on j10 x pc rx to txd on j10 x pc gnd to gnd on j10 $/#             $/#                     c
d+5&e c
d12e      +
54 edisplay (op7200)  master.c ?this program demonstrates a simple rs-485 transmission of lower case letters to a slave. the slave will send back converted upper case letters back to the master op7200 and display them in the stdio window. use slave.c to program the slave.  slave.c ?this program demonstrates a simple rs-485 transmission of lower case letters to a master op7200. the slave will se nd back converted upper case letters back to the master op7200 and display them in the stdio window. use master.c to pro- gram the master op7200. 4.3.4 a/d converter inputs the following sample programs are found in the adc subdirectory in samples\op7200 .  adcal_diff_2v.c ?demonstrates how to recalibrate an a/d input channel being used for a differential input with the input attenuator tied to the 2 v reference voltage.  adcal_diff_gnd.c ?demonstrates how to recalibrate an a/d input channel being used for a differential input with the input attenuator tied to analog ground.  adcal_ma_ch.c ?demonstrates how to recalibrate an a/d input channel being used to convert analog current measurements to genera te the calibration constants for that channel.  adcal_se_all.c ?demonstrates how to recalibrate all single-ended a/d input chan- nels for a given gain.  adcal_se_ch.c ?demonstrates how to recalibrate one single-ended a/d input chan- nels to generate the calibration constants for that channel. note: the above sample programs will overwrite the calibration constants set at the factory.  adrd_diff_2v.c ?demonstrates how to read an a/ d input channel being used for a differential input with the input attenuator tied to the 2 v reference voltage.  adrd_diff_gnd.c ?demonstrates how to read an a/d input channel being used for a differential input with the i nput attenuator tied to analog ground.  adrd_ma_ch.c ?demonstrates how to read an a/d input channel being used to con- vert analog current measurements using pr eviously defined calibration constants for that channel.  adrd_se_all.c ?demonstrates how to read all single-ended a/d input channels using previously defined calibration constants.  adrd_se_ch.c ?demonstrates how to read one single-ended a/d input channels using previously defined calibration constants.
user?s manual 55 4.3.5 graphic display the following sample program is found in the lcd_basic subdirectory in samples\op7200 .  bufflock.c ?demonstrates how to improve lcd performance by using the glbufflock and glbuffunlock functions.  contrast.c ?demonstrates how to adjust the contrast on the lcd.  primitives.c ?demonstrates the primitive graphic functions to draw lines, circles, polygons, and bitmaps.  scrolling.c ?demonstrates the scrolling features of the graphic.lib library.  text.c ?demonstrates the text features of the graphic.lib library. 4.3.6 keypad the following sample programs are found in the lcd_keypad subdirectory in samples\op7200 .  kp_16key.c ?demonstrates using 9-key keypad inst ead of touchscreen to control vir- tual keypad.  kp_analog.c ?demonstrates using 9-key keypad instead of touchscreen to control virtual keypad.  kp_basic.c ?demonstrates the keypad functions.  kp_menu.c ?demonstrates how to implem ent a menu system using the glmenu.lib library. 4.3.7 touchscreen (op7200 only) the following sample program is found in the lcd_touchscreen subdirectory in samples\op7200 .  btn_16key.c ?demonstrates the use of a virtual keypad for data entry.  btn_basics.c ?demonstrates the basic functionality of the touchscreen buttons.  btn_keyboard.c ?demonstrates the use of a virtual keypad for data entry.  cal_touchscreen.c ?demonstrates how to recalibrate the touchscreen coordinates.  rd_touchscreen.c ?demonstrates how to read th e touchscreen in debounced or real-time modes.  tscust16key.lib ?sample library demonstrating how to make custom keysets using gltouchscreen.lib .  tscustkeyboard.lib ?sample library demonstrating how to make custom keysets using gltouchscreen.lib functions.
56 edisplay (op7200) 4.3.8 using system information from the rabbitcore module calibration constants for the a/d converter are stored in the simulated eeprom area of the flash memory. you may find it useful to re trieve the calibration constants and save them for future use, for example, if you s hould need to replace the rabbitcore module on the op7200. the following sample programs, found in the calib_save_retrieve subdirectory in samples\op7200 , illustrate how to save or retrieve the calibration constants. note that both sample programs prompt you to use a se rial number for the op7200. this serial num- ber can be any 5-digit number of your choice , and will be unique to a particular op7200. do not use the mac address on the bar code labe l of the rabbitcore module attached to the op7200 since you may at some later time use that particular rabbitcore module on another op7200, and the previously saved calibration data would no longer apply.  savecalib.c ?this program demonstrates how to save your analog calibration coef- ficients using a serial port and a pc serial utility such as tera term. note: use the sample program getcalib.c to retrieve the data and rewrite it to the single-board computer.  getcalib.c ?this program demonstrates how to retrieve your analog calibration data to rewrite it back to the simulated eeprom in flash with using a serial utility such as tera term. note: calibration data must be saved previously in a file by the sample program savecalib.c . note: in addition to loading the calibration constants on the replacement rabbitcore module, you will also have to add the product information for the op7200 to the id block associated with the rabbitcore module. the sample program write_ idblock.c , available on the our web site at www.rabbit.com/support/feature_ downloads.shtml , provides specific instructions and an example. two sample programs are available to show how to get information on id and user blocks, and how to clear the contents in the user block. these sample programs are in the dynamic c samples\userblock folder.  userblock_info.c ?this program reports on the size and capabilities of the id and user blocks. it will report the version of the id block, the size of the id and user blocks, the size of the user blocks reserved for calibration constants, whether the id or user blocks are mirrored, and the total amount of flash memory used by the id and user blocks.  userblock_clear.c ?this program clears the contents of the user block. note that it does not clear the calibration c onstants or the system id block. when you run this sample program in the pr ogram mode, there is a 300 ms timer delay after each writeuserblock() call to allow dynamic c and the op7200 to exchange a debug packet in order to inform the debug kernel that the op7200 is still ?alive.? the timer delay is not necessary in the run mode with nodebug or when single-stepping.
user?s manual 57 4.4 op7200 libraries the following library folders contain the librar ies whose function calls are used to develop applications for the op7200.  op7200 ?libraries associated with features specific to the op7200. the functions in the op72xx.lib library are described in section 4.5, ?op7200 function apis.?.  displays ?libraries associated with the lcd display. the glmenu.lib library pro- vides function calls to display menus on the op7200 lcd display.  keypads ?libraries associated with the keypad. the keypad9.lib library provides function calls to keypad menus for the op7200 keypad.  touchscreens ?libraries associated with the touchscreen. the gltouchscreen.lib library allows you to link adjacent pixel lo cations on the lcd to create a button. the button can then be translated by the touchscreen when pressed. the ts_r4096.lib library in the touchscreens directory provides low-leve l touchscreen function calls.  rabbitnet ?libraries associated with the rabbitnet network. the rn_cfg_ op72.lib library is used to configure the op 7200 for use as a master with rabbitnet peripheral cards. the function calls in the rnet.lib library are used to set up the rab- bitnet network, and are described in appendi x d. each rabbitnet i/o card also has its own library in this folder, and these function calls are described in the user?s manual for each i/o card. call the libraries you intend to use in the following order. #use "op72xx.lib" #use "glmenu.lib" #use "keypad9.lib" #use "rn_cfg_op72.lib" #use "net.lib" finally, call the library or libraries associ ated with the rabbitnet i/o card(s) in your rabbitnet system, for example, #use "rnet_dio.lib" for the rabbitnet digital i/o card other generic functions applicable to all devices based on the rabbit 2000 microprocessor are described in the dynamic c function reference manual .
58 edisplay (op7200) 4.5 op7200 function apis 4.5.1 board initialization call this function at the beginning of your program. this function initializes the system i/o ports and loads all the a/d converter calibration constants from flash memory into sram for use by your pro- gram. this function will turn off led ds1 (microprocessor bad) to indicate that the initialization was successful. the ports are initialized according to table a-3. void brdinit (void);
user?s manual 59 4.5.2 digital i/o this functions is used to configure the high-current outputs as either a sinking or a sourcing type output. note that brdinit must be executed before calling this function. parameters outputmode is an 8-bit parameter where each bit corresponds to a high-current output: bit 7 = out7 bit 6 = out6 bit 5 = out5 bit 4 = out4 bit 3 = out3 bit 2 = out2 bit 1 = out1 bit 0 = out0 to set the outputs, set the corresponding bit to one of the following states: 0 = sinking type circuit 1 = sourcing type circuit example digoutconfig(0x81); // out0 and out7 are sourcing, out1?ount6 are sinking see also brdinit, digin, digout, tristateconfig, digouttristate sets the state of a digital output ( out0?out7) . the output channel is set to the state that is specified. if the output is configured as sinking, set to 0 for the driver to be sinking, or set to 1 for the driver to be off (high-impedance state). if the output is con- figured as sourcing, set to 0 for the driver to be off (high-impedance state), or set to 1 for the driver to be sourcing. remember to call brdinit and digoutconfig before executing this function. a runtime error will occur for the following conditions: 1. channel or state out of range. 2. brdinit or digoutconfig was not executed before executing digout . 3. your tried to use a channel configured as a tri-state output. parameters channel is the output channel number (0?7). state is the output value (0 or 1). see also brdinit, digoutconfig, tristateconfig, digouttristate void digoutconfig(char outputmode); void digout(int channel, int state);
60 edisplay (op7200) allows a given channel to be config ured as a tristate type output. wh en a channel is configured as a tristate output, then digouttristate can be used to control that channel. a run-time error will occur for the following conditions: 1. digout is disabled from controlling any channel that is configured as a tristate output. 2. brdinit was not executed before executing digtristateconfig . parameter tristate is an 8-bit parameter where each bit corresponds to a high-current output: bit 7 = out7 bit 6 = out6 bit 5 = out5 bit 4 = out4 bit 3 = out3 bit 2 = out2 bit 1 = out1 bit 0 = out0 to set the outputs, set the corresponding bit to one of the following states: 0 = tristate operation disabled 1 = tristate operation enabled example digtristateconfig(0x02); // out1 tristate is enabled, // out0, out2?ount7 tristate are disabled see also brdinit, digin, digoutconfig, digout, digouttristate void digtristateconfig(char tristate);
user?s manual 61 sets the state of a digital output channel (out0?out7). this function is intended to control a given channel as a tristate output, for example: 0 = active low state (gnd potential) 1 = active high state (+k potential) 2 = high-impedance state. since switching from one state to another has some software overhead, the switching delay should be less than 1 s. a run-time error will occur for the following conditions: 1. channel or state out of range. 2. brdinit or digtristateconfig was not executed before executing digouttristate . 3. your tried to use a channel that is not configured as a tristate output. parameters channel is the output channel number (0?7). state is set to one of the following output states. 0 = active low. 1 = active high 2 = high-impedance state. see also brdinit, digin, digoutconfig, digout, tristateconfig reads the state of an input channel (in0?in18 for op7200, in0?in15 for op7210). a run-time error will occur for the following conditions: 1. channel out of range. 2. brdinit was not executed before executing digin . parameter channel is the input channel number (0?18 or 0?15) return value the logic state of the input (0 or 1). see also brdinit, digout void digouttristate(int channel, int state); int digin(int channel);
62 edisplay (op7200) 4.5.3 leds turns led ds1 (microprocessor bad) on or off. note: once the brdinit function executes, then the microprocessor bad indicator is available for other use in the application. p arameters led is the led to control 0 = led ds1 (microprocessor bad indicator) value is used to control whether the led is on or off 0 = off 1 = on see also brdinit void ledout(int led, int value)
user?s manual 63 4.5.4 serial communication library files included with dynamic c provide a full range of serial communication sup- port. the rs232.lib library provides a set of circular -buffer-based serial functions. the packet.lib library provides packet-based serial functions where packets can be delim- ited by the 9th bit, by transmission gaps, or with user-defined special characters. both libraries provide blocking functions, which do not return until they are finished transmit- ting or receiving, and nonblocking functions, wh ich must be called repeatedly until they are finished. for more information, see the dynamic c function reference manual and technical note 213, rabbit 2000 serial port software . if you are planning to use any of the rs-232 serial ports and the rabbitnet port on the op7200, initialize the serial port(s) before you initialize the rabbitnet port. the follow- ing sample code illustrates this sequence. // initialize serial port c, set baud rate to 19200 sercopen(19200); sercwrflush(); sercrdflush(); // initialize serial port d, set baud rate to 19200 serdopen(19200); serdwrflush(); serdrdflush(); // set serial mode...must be done after serxopen function(s) and before rabbitnet initialization sermode(0); // initialize rabbitnet port rn_init(rn_ports, 1); use the following function calls with the op7200. note that serial port b is used for both rs-485 and the rabbitnet port, so that rs -485 is no longer available once you have con- figured serial port b as a rabbitnet port.
64 edisplay (op7200) user interface to set up op7200 serial communication lines. call this function after serxopen() . whether you are opening one or multiple serial ports, this function must be executed after executing the last serxopen function and before you start using any of the serial ports. this function is non-reentrant. if mode 1 or mode 3 is selected, cts/rts flow control is exercised using the sercflowcontrolon and sercflowcontroloff functions from the rs232.lib library. parameter mode is the defined serial port configuration. return value 0 if valid mode, 1 if not. see also ser485tx, ser485rx enables the rs-485 transmitter. transmitted data get echo'ed back into the receive data buffer. these echo'ed data could be used to know when to disable the transmitter by using one of the following methods: byte mode?disable the transmitter after the same byte that is transmitted is detected in the receive data buffer. block data mode?disable the transmitter after the same number of bytes transmitted is detected in the receive data buffer. sermode() must be executed before running this function. see also sermode, ser485rx disables the rs-485 transmitter. this puts the op7200 in listen mode, which allows it to receive data from the rs-485 interface. sermode() must be executed before running this function. see also sermode, ser485tx int sermode(int mode); mode serial port b c d 0 rs-485 rs-232, 3-wire rs-232, 3-wire 1 rs-485 rs-232, 5-wire cts/rts 2 not initialized * * use modes 2 and 3 when serial port b is going to used by other libraries such as packet.lib . rs-232, 3-wire rs-232, 3-wire 3 not initialized * rs-232, 5-wire cts/rts void ser485tx(void); void ser485rx(void);
user?s manual 65 4.5.5 a/d converter inputs (op7200 only) reads the state of an analog input channel. parameters channel is the analog input channel number (0 to 7) corresponding to ain0?ain7: opmode is the mode of operation: 0 = se_mode ?single-ended input line 1 = diff_mode ?differential input line 2 = mamp_mode ?4?20 ma input line gaincode is the gain code of 0 to 7 for both single-ended and differential measurements: return value a value corresponding to the voltage on the analog input channel, which will be: 0?2047 for 11-bit a/d conversions (signed 12th bit) see also anainvolts, anaincalib, brdinit, anainmamps, anaindiff unsigned int anain(int channel, int opmode, int gaincode); channel single-ended input differential input 0 +ain0 +ain0 -ain1 1 +ain1 ? 2 +ain2 +ain2 -ain3 3 +ain3 ? 4 +ain4 +ain4 -ain5 5 +ain5 ? 6 +ain6 +ain6 -ain7 7 +ain7 ? gain code macro gain 0 gain_x1 1 1 gain_x2 2 2 gain_x4 4 3 gain_x5 5 4 gain_x8 8 5 gain_x10 10 6 gain_x16 16 7 gain_x20 20
66 edisplay (op7200) calibrates the response of the a/d converter channel as a linear function using the two conversion points provided. four values are calculated and placed into global table _adccalib to be stored later into using the function anaineewr() . each channel will have the following information: a linear constant, a voltage offset, a calculation gain code used to calculate calibrations, and a user gain code to set voltage range (defaults to the calculation gain code). parameters channel is the analog input channel number (0 to 7) corresponding to ain0?ain7: opmode is the mode of operation: 0 = se_mode ?single-ended input line 1 = diff_mode ?differential input line 2 = mamp_mode ?4?20 ma input line gaincode is the gain code of 0 to 7 for both single-ended and differential measurements: int anaincalib(int channel, int opmode, int gaincode, int value1, float volts1, int value2, float volts2); channel single-ended input differential input 0 +ain0 +ain0 -ain1 1 +ain1 ? 2 +ain2 +ain2 -ain3 3 +ain3 ? 4 +ain4 +ain4 -ain5 5 +ain5 ? 6 +ain6 +ain6 -ain7 7 +ain7 ? gain code macro gain 0 gain_x1 1 1 gain_x2 2 2 gain_x4 4 3 gain_x5 5 4 gain_x8 8 5 gain_x10 10 6 gain_x16 16 7 gain_x20 20
user?s manual 67 value1 is the first a/d converter channel value (0?2047). volts1 is the voltage or current corresponding to the first a/d conv erter channel value. value2 is the second a/d converter channel value (0?2047). volts2 is the voltage or current corresponding to the first a/d conv erter channel value. return value 0 if successful. -1 if not able to make calibration constants. see also anain, anainvolts, brdinit, anainmamps, anaindiff, anaineerd, anaineewr
68 edisplay (op7200) reads the state of a single-ended analog input channe l and uses the previously set calibration constants to convert the reading to volts. parameters channel is the analog input channel number (0 to 7) corresponding to ain0?ain7: gaincode is the gain code of 0 to 7 for both single-ended and differential measurements: return value a voltage value corresponding to the voltage on the analog input channel. see also anaincalib, anain, brdinit, anainmamps, anaindiff float anainvolts(int channel, int gaincode); channel single-ended input 0 +ain0 1 +ain1 2 +ain2 3 +ain3 4 +ain4 5 +ain5 6 +ain6 7 +ain7 gain code macro gain voltage range 0 gain_x1 1 0?20 v 1 gain_x2 2 0?10 v 2 gain_x4 4 0?5 v 3 gain_x5 5 0?4 v 4 gain_x8 8 0?2.5 v 5 gain_x10 10 0?2 v 6 gain_x16 16 0?1.25 v 7 gain_x20 20 0?1 v
user?s manual 69 reads the state of a differential analog input channel and uses the previously set calibration constants to convert it to volts. parameters channel is the channel number (0, 2, 4, 6): gaincode is the gain code of 0 to 7: return value a voltage value corresponding to the voltage on the analog input channel. see also brdinit, anaincalib, anain, anainvolts, anainmamps float anaindiff(unsigned int channel, unsigned int gaincode); channel differential input lines 0 +ain0 -ain1 2 +ain2 -ain3 4 +ain4 -ain5 6 +ain6 -ain7 gain code macro gain voltage range 0 gain_x1 1 -20 to 20 v 1 gain_x2 2 -10 to 10 v 2 gain_x4 4 -5 to 5 v 3 gain_x5 5 -4 to 4 v 4 gain_x8 8 -2.5 to 2.5 v 5 gain_x10 10 -2 to 2 v 6 gain_x16 16 -1.25 to 1.25 v 7 gain_x20 20 -1 to 1v
70 edisplay (op7200) reads the state of an analog input channel and uses the previously set calibration constants to convert it to current. parameter channel is 0?7: return value a current value between 4?20 ma (0.004 and 0.020 a) corresponding to the curr ent on the analog input channel. see also brdinit, anaincalib, anain, anainvolts, anaindiff int anainmamps(unsigned int channel); channel 4?20 ma input lines 0 ain0 1 ain1 2 ain2 3 ain3 4 ain4 5 ain5 6 ain6 7 ain7
user?s manual 71 reads the calibration constants, gain, and offset for an input based on its designated channel code position into global table _adccalib . the constants are stored in the top 1k of the reserved user block memory area. use the sample program userblockinfor.c in samples\op7200 to get the addresses reserved for the calibration data c onstants and the addresses available for use by your program. note: this function cannot be run in ram. parameters channel is the analog input channel number (0 to 7) corresponding to ain0?ain7: opmode is the mode of operation: 0 = se_mode ?single-ended input line 1 = diff_mode ?differential input line 2 = mamp_mode ?4?20 ma input line gaincode is the gain code of 0 to 7 for both single-ended and differential measurements: int anaineerd(unsigned int channel, int opmode, unsigned int gaincode); channel single-ended input differential input 0 +ain0 +ain0 -ain1 1 +ain1 ? 2 +ain2 +ain2 -ain3 3 +ain3 ? 4 +ain4 +ain4 -ain5 5 +ain5 ? 6 +ain6 +ain6 -ain7 7 +ain7 ? -1 all_channels all_channels gain code macro gain 0 gain_x1 1 1 gain_x2 2 2 gain_x4 4 3 gain_x5 5 4 gain_x8 8 5 gain_x10 10 6 gain_x16 16 7 gain_x20 20
72 edisplay (op7200) return value 0 if successful. -1 if address is invalid or out of range. see also anaineewr, anaincalib, brdinit
user?s manual 73 writes the calibration constants, gain, and offset for an input based on its designated channel code position from global table _adccalib . the constants are stored in th e top 1k of the reserved user block memory area. use the sample program userblockinfor.c in samples\op7200 to get the addresses reserved for the calibration data c onstants and the addresses available for use by your program. note: this function cannot be run in ram. channel is the analog input channel number (0 to 7) corresponding to ain0?ain7: opmode is the mode of operation: 0 = se_mode ?single-ended input line 1 = diff_mode ?differential input line 2 = mamp_mode ?4?20 ma input line gaincode is the gain code of 0 to 7 for both single-ended and differential measurements: int anaineewr(unsigned int channel, int opmode, unsigned int gaincode); channel single-ended input differential input 0 +ain0 +ain0 -ain1 1 +ain1 ? 2 +ain2 +ain2 -ain3 3 +ain3 ? 4 +ain4 +ain4 -ain5 5 +ain5 ? 6 +ain6 +ain6 -ain7 7 +ain7 ? -1 all_channels all_channels gain code macro gain 0 gain_x1 1 1 gain_x2 2 2 gain_x4 4 3 gain_x5 5 4 gain_x8 8 5 gain_x10 10 6 gain_x16 16 7 gain_x20 20
74 edisplay (op7200) return value 0 if successful. -1 if address is invalid or out of range. see also anaineerd, brdinit
user?s manual 75 4.5.6 graphic display functions 4.5.6.1 on-screen menus the glmenu.lib library in the lib\displays\graphic directory provides function calls to display menus on the op7200 lcd display. when x and y coordinates on the display screen are specified, x can range from 0 to 319, and y can range from 0 to 239. these numbers represent pixels counted fr om the top left corner of the display. initializes a menu structure with the required paramete rs to automatically build and display a text menu when the glmenu function is executed. parameters menu is a pointer to the windowmenu descriptor pfont is a pointer to the fontinfo descriptor border describes the menu border options: 0 = no_border , no border drawn 1 = single_line , draw a single-line border around the text menu 2 = double_line , draw a double-line border around the text menu shadow describes the menu shadow options: 0 = no_shadow , no shadowing provided 1 = shadowing , shadowing is provided on the menu menu_options is a pointer to the list of menu options?here is an example of a list of options for the menu system: // menu options........set as needed for your application const char *main_menu [] = { "1.increase menu size", "2.decrease menu size", "3.backlight menu", "" }; it is possible to insert or delete menu options. the highlight bar is set up to start with the first menu option and stop at the last menu option in the menu. when adding or deleting menu options you must match up the case statements to the menu option number. title is the menu title ascii string = title null string = no title maxoptdisplayed indicates the maximum number of options to be displayed by the menu: -1 = forces all options to be displayed >0 = menu box will only display the number of options indicated, which will require the user to use the scroll keys to bring an option into the menu box view area for the selection int glmenuinit(windowmenu *menu, fontinfo *pfont, int border, int shadow, char **menu_options, char* title, maxoptdisplayed);
76 edisplay (op7200) return value 0 = success -1 = border parameter value is invalid see also glmenu, glmenuclear, glrefreshmenu displays a menu on the lcd display and get the menu options from the user. note: this function will display an error message on the lcd if the menu width or height exceeds the lcd display boundaries. parameters mptr is a pointer to structure that contains the information for the menu state is a pointer to the menu control parameter. the state parameters are as follows: 0 = menu_init , initialize and display menu 1 = menu_no_change , return to selected option, no changes to menu or highlight bar. 2 = menu_refresh , display the last image of the menu, including the location of the highlight bar. x is the x coordinate of where the text menu is to start y is the y coordinate of where the text menu is to start return value 0 = no option is selected >0 = option the user has selected -1 = menu has exceeded lcd screen width -2 = menu has exceeded lcd screen height see also glmenuinit, glmenuclear, glrefreshmenu refreshes the menu indicated by the windowmenu pointer. parameter mptr is a windowmenu descriptor pointer return value none. see also glmenuinit, glmenu, glmenuclear int glmenu(windowmenu *mptr, int *state, int x, int y); void glrefreshmenu(windowmenu *mptr);
user?s manual 77 clears the menu indicated by the windowmenu descriptor pointer. parameter mptr is a windowmenu descriptor pointer return value none. see also glrefreshmenu, glmenu, glmenuinit glmenuclear(windowmenu *mptr);
78 edisplay (op7200) 4.5.6.2 graphic drawing routines the graphic.lib library in the displays\graphic directory provides function calls for primitive graphic drawing routines such as lines, circles, and polygons. initializes the display devices, clears the screen. this function call must be made prior to any other graphic function calls. see also gldisponoff, glbacklight, glsetcontrast, glplotdot, glblock, glplotpolygon, glplotcircle, glhscroll, glvscroll, glxfontinit, glprintf, glputchar, glsetbrushtype, glbufflock, glbuffunlock, glplotline increments lcd screen-locking counter. graphics calls are recorded in the lcd memory buffer, and are not transferred to the lcd if the counter is non-zero. note: functions glbufflock() and glbuffunlock() can be nested up to a level of 255, but be sure to balance the calls. it is not a requirement to use these procedures, but a set of glbufflock() and glbuffunlock() bracketing a set of related graphics calls significantly speeds up the rendering. see also glbuffunlock, glswap decrements lcd screen-locking counter. the contents of the lcd buffer are transferred to the lcd if the counter goes to zero. see also glbufflock, glswap checks the lcd screen-locking counter. the contents of the lcd buffer are transf erred to the lcd if the counter is zero. see also glbufflock, glbuffunlock void glinit(void); void glbufflock(void); void glbuffunlock(void); void glswap(void);
user?s manual 79 fills the lcd display screen with a pattern. parameter pattern 0xff = all black 0x00 = all white anything else = vertical stripes see also glblock, glblankscreen, glplotpolygon, glplotcircle blanks (sets to white) the lcd display screen. see also glfillscreen, glblock, glplotpolygon, glplotcircle sets the drawing method (or color) of pixels drawn by subsequent graphics calls. parameter type is the value can be one of the following macros: pixblack draws black pixels pixwhite draws white pixels pixxor draws old pixel xor'ed with the new pixel see also glgetbrushtype void glfillscreen(int pattern); void glblankscreen(void); void glsetbrushtype(int type);
80 edisplay (op7200) gets the current method (or color) of pixels drawn by subsequent graphics calls. return value the current brush type. see also glsetbrushtype draws a single pixel in the lcd buffer, an d on the lcd if the buffer is unlocked. if the coordinates are outside the lcd di splay area, the dot will not be plotted. parameters x is the x coordinate of the dot y is the y coordinate of the dot see also glplotline, glplotpolygon, glplotcircle draws a line in the lcd buffer, and on the lcd if the buffer is unlocked. any portion of the line that is beyond the lcd display area will be clipped. parameters x0 is the x coordinate of one endpoint of the line y0 is the y coordinate of one endpoint of the line x1 is the x coordinate of the other endpoint of the line y1 is the y coordinate of the other endpoint of the line see also glplotdot, glplotpolygon, glplotcircle void glgetbrushtype(void); void glplotdot(int x, int y); void glplotline(int x0, int y0, int x1, int y1);
user?s manual 81 draws a rectangular block in the page buffer, and on the lcd if the buffer is unlocked. any portion of the block that is outside the lcd display area will be clipped. parameter x is the x coordinate of the upper left corner of the block y is the y coordinate of the left top corner of the block bmwidth is the width of the block bmheight is the height of the block see also glfillscreen, glblankscreen, glplotpolygon, glplotcircle plots the outline of a polygon in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the polygon that is outside the lcd display area will be clipped. the function will also return, doing nothing, if there are less than 3 vertices. parameters n is the number of vertices x1 is the x coordinate of the first vertex y1 is the y coordinate of the first vertex x2 is the x coordinate of the second vertex y2 is the y coordinate of the second vertex ... coordinates of additional vertices see also glplotvpolygon, glfillpolygon, glfillvpolygon void glblock(int x, int y, int bmwidth, int bmheight); void glplotpolygon(int n, int x1, int y1, int x2, int y2, ...);
82 edisplay (op7200) draws a filled polygon in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the polygon that is outside the lcd display area will be clipped. the function will also return, doing nothing, if there are less than 3 vertices. parameters n is the number of vertices x1 is the x coordinate of the first vertex y1 is the y coordinate of the first vertex x2 is the x coordinate of the second vertex y2 is the y coordinate of the second vertex ... coordinates of additional vertices see also glfillvpolygon, glplotpolygon, glplotvpolygon plots the outline of a polygon in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the polygon that is outside the lcd display area will be clipped. the function will also return, doing nothing, if there are less than 3 vertices. parameters n is the number of vertices pfirstcoord is a pointer to an array of vertex coordinates x1,y1 , x2,y2 , x3,y3 , ... see also glplotpolygon, glfillpolygon, glfillvpolygon draws a filled polygon in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the polygon that is outside the lcd display area will be clipped. the function will also return, doing nothing, if there are less than 3 vertices. parameters n is the number of vertices pfirstcoord is a pointer to an array of vertex coordinates x1,y1 , x2,y2 , x3,y3 , ... see also glfillpolygon, glplotpolygon, glplotvpolygon void glfillpolygon(int n, int x1, int y1, int x2, int y2, ...); void glplotvpolygon(int n, int *pfirstcoord); void glfillvpolygon(int n, int *pfirstcoord);
user?s manual 83 draws a circle in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the circle that is outside the lcd display area will be clipped. parameters xc is the x coordinate of the center of the circle yc is the y coordinate of the center of the circle rad is the radius of the circle (in pixels) see also glfillcircle, glplotpolygon, glfillpolygon draws a filled circle in the lcd page buffer, and on the lcd if the buffer is unlocked. any portion of the circle that is outside the lcd display area will be clipped. parameters xc is the x coordinate of the center of the circle yc is the y coordinate of the center of the circle rad is the radius of the circle (in pixels) see also glplotcircle, glplotpolygon, glfillpolygon initializes the font descriptor structure, where the font is stored in xmem . each font character's bitmap is column-major and byte-aligned. parameters pinfo is a pointer to the font descriptor to be initialized pixwidth is the width of each font item (in pixels) pixheight is the height of each font item (in pixels) startchar is the value of the first printable character in the font character set endchar is the value of the last printable character in the font character set xmembuffer is an xmem address of the pointer to a linear array of font bitmaps see also glprinf void glplotcircle(int xc, int yc, int rad); void glfillcircle(int xc, int yc, int rad); void glxfontinit(fontinfo *pinfo, char pixwidth, char pixheight, unsigned startchar, unsigned endchar, unsigned long xmembuffer);
84 edisplay (op7200) prints a formatted string (much like printf ) on the lcd screen. only the character codes that exist in the font set are printed, all othe rs are skipped over. for example, '\b' , '\t' , '\n' , and '\r' (ascii backspace, tab, new line, and carriage return, respectively) will be printed if they exist in the font set, but will not have any effect as control characters. any portion of the bitmap char acter that is outside the lcd display area will be clipped. parameters x is the x coordinate (column) of the upper left corner of the text y is the y coordinate (row) of the left top corner of the text pinfo is a pointer to the window frame descriptor fmt is a formatted string ... is a formatted string of conversion parameter(s) example glprintf(0,0, &fi12x16, "test %d\n", count); see also glxfontinit sets the glprintf() printing step direction. the x and y step directions are independent signed val- ues. the actual step increments depend on the height and width of the font being displayed, which are multiplied by the step values. use glgetpfstep() to examine the current x and y printing step direction. parameters stepx is the glprintf x step value stepy is the glprintf y step value see also glgetpfstep gets the current glprintf() printing step direction. each step direction is independent of the other, and is treated as an 8-bit signed value. the actual step increments depends on the height and width of the font being displayed, which are multiplied by the step values. use glsetpfstep() to control the x and y printing step direction. return value the x step is returned in the msb, and the y step is returned in the lsb of the integer result. see also glsetpfstep void glprintf(int x, int y, fontinfo *pinfo, char *fmt, ...); void glsetpfstep(int stepx, int stepy); void glgetpfstep(void);
user?s manual 85 returns the xmem address of a character from the specified font set. parameters pinfo is the xmem address of the bitmap font set latter is an ascii character return value the xmem address of the bitmap character font, column-major and byte-aligned. see also glputfont, glprintf puts an entry from the font table to the page buffer , and on the lcd if the buffer is unlocked. each font character's bitmap is column-major and byte-aligned. any portion of the bitmap char acter that is outside the lcd display area will be clipped. parameters x is the x coordinate (column) of the upper left corner of the text y is the y coordinate (row) of the left top corner of the text pinfo is a pointer to the window frame descriptor code is the ascii character to display see also glfontcharaddr, glprintf provides an interface between the stdio string handling functions and the graphic library. the stdio string formatting function will call this function, one character at a time, until the entire format- ted string has been parsed. any portion of the bitmap char acter that is outside the lcd display area will be clipped. parameters ch is the character to be displayed on the lcd ptr is not used, and is a place holder due to the stdio string functions cnt is not used, and is a place holder due to the stdio string functions pinfo is a pointer to the window frame descriptor see also glprintf, glputfont unsigned long glfontcharaddr(fontinfo *pinfo, char letter); void glputfont(int x, int y, fontinfo *pinfo, char code); void glputchar(char ch, char *ptr, int *cnt, glputcharinst *pinst)
86 edisplay (op7200) defines a text-only display window. this function provides a way to display characters within the text window only using character row and column coordinates. the text window feature provides end-of-line wrapping and clipping after the character in the last col- umn and row is displayed. note: be sure to execute the textwindowframe function before using any of the text-only functions ( textgotoxy , textputchar , textprintf , textcursorlocation ). parameters window is a pointer to the window frame pfont is a pointer to the window frame descriptor x is the x coordinate of where the text window frame is to start y is the y coordinate where the text window frame is to start winwidth is the width of the text window frame winheight is the height of the text window frame return value 0 = window frame was successfully created -1 = x coordinate + width has exceeded the display boundary -2 = y coordinate + height has exceeded the display boundary see also textputchar, textprintf, textcursorlocation, textgotoxy sets the cursor location on the display of where to display the next character. the display location is based on the height and width of the character to be displayed. note: be sure to execute the textwindowframe function before using any of the text-only functions ( textgotoxy , textputchar , textprintf , textcursorlocation ). parameters window is a pointer to the window frame col is the character column location row is the character row location see also textputchar, textprintf, textwindowframe, textcursorlocation int textwindowframe(windowframe *window, fontinfo *pfont, int x, int y, int winwidth, int winheight) void textgotoxy(windowframe *window, int col, int row);
user?s manual 87 gets the current cursor location that was set by one of the graphic text functions. note: be sure to execute the textwindowframe function before using any of the text-only functions ( textgotoxy , textputchar , textprintf , textcursorlocation ). parameters window is a pointer to the window frame col is a pointer to the cursor column variable row is a pointer to the cursor row variable return value lower word = cursor row location upper word = cursor column location see also textgotoxy, textprintf, textwindowframe, textputchar displays a character on the display where the cursor is currently pointing. if any portion of the bitmap character is outside the lcd display area, the character will not to be displayed. note: be sure to execute the textwindowframe function before using any of the text-only functions ( textgotoxy , textputchar , textprintf , textcursorlocation ). parameters window is a pointer to the window frame ch is the character to be displayed on the lcd see also textgotoxy, textprintf, textwindowframe, textcursorlocation void textcursorlocation(windowframe *window, int *col, int *row); void textputchar(struct windowframe *window, char ch);
88 edisplay (op7200) this function prints a formatted string (much like printf ) on the lcd screen. only printable charac- ters in the font set are printed; escape sequences '\r' and '\n' are also recognized. all other escape sequences will be skipped over. for example, nothing will be displayed for '\b' and 't' . the text window feature provides end-of-line wrapping and clipping after the character in the last col- umn and row is displayed. note: be sure to execute the textwindowframe function before using any of the text-only functions ( textgotoxy , textputchar , textprintf , textcursorlocation ). parameters window is a pointer to the window frame fmt is a formatted string ... formatted-string conversion parameter(s) example textprintf(&textwindow, "test %d\n", count); see also textgotoxy, textputchar, textwindowframe, textcursorlocation scrolls byte-aligned window left one pixel, right column filled by current pixel type (color). parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window see also glhscroll, glright1 scrolls byte-aligned window right one pixel, left column filled by current pixel type (color). parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window see also glhscroll, glleft1 void textprintf(struct windowframe *window, char *fmt, ...); void glleft1(int left, int top, int cols, int rows); void glright1(int left, int top, int cols, int rows);
user?s manual 89 scrolls right or left within the defined window by npix number of pixels. the opposite edge of the scrolled window will be filled in with white pixels. the window must be byte-aligned. parameters will be verified for the following: 1. the left and column parameters will be verified that they are evenly divisible by 8. if not, they will be changed to be a value that is a multiple of 8. 2. parameters will be checked to verify that the scrolling area is valid. the minimum scrolling area is a width of 8 pixels and a height of one row. parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window npix is the number of pixels to scroll within the defined window (negative value to scroll left) see also glvscroll scrolls byte-aligned window up one pixel, bottom row filled by current pixel type (color). parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window see also glvscroll, gldown1 scrolls byte-aligned window down one pixel, top row filled by current pixel type (color). parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window see also glvscroll, glup1 void glhscroll(int left, int top, int cols, int rows, int npix); void glup1(int left, int top, int cols, int rows); void gldown1(int left, int top, int cols, int rows);
90 edisplay (op7200) scrolls up or down within the defined window by npix number of pixels. the opposite edge of the scrolled window will be filled in with white pixels. the window must be byte-aligned. parameters will be verified for the following: 1. the left and column parameters will be verified that they are evenly divisible by 8. if not, they will be changed to be a value that is a multiple of 8. 2. parameters will be checked to verify that th e scrolling area is valid. the minimum scrolling area is a width of 8 pixels and a height of one row. parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap cols is the number of columns in the window, must be evenly divisible by 8 rows is the number of rows in the window npix is the number of pixels to scroll within the defined window (negative value to scroll up) see also glhscroll draws bitmap in the specified space. th e data for the bitmap are stored in xmem . this function automat- ically calls glxputfastmap if the bitmap is byte-aligned (lef t edge and width are each evenly divis- ible by 8). any portion of a bitmap image or character that is outside the lcd display area will be clipped. parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap width is the width of the bitmap height is the height of the bitmap bitmap is the address of the bitmap in xmem see also glxputfastmap, glprintf void glvscroll(int left, int top, int cols, int rows, int npix); void glxputbitmap(int left, int top, int width, int height, unsigned long bitmap);
user?s manual 91 draws bitmap in the specified space. th e data for the bitmap are stored in xmem . this is like glxputbitmap , except that it's faster. the restriction is that the bitmap must be byte-aligned. any portion of a bitmap image or character that is outside the lcd display area will be clipped. parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap width is the width of the bitmap height is the height of the bitmap bitmap is the address of the bitmap in xmem see also glxputbitmap, glprintf gets a bitmap from the lcd page buffer and stores it in xmem ram. this function automatically calls glxgetfastmap if the bitmap is byte-aligned (left edge and width are each evenly divisible by 8). parameters x is the x coordinate of the left edge of the bitmap (in pixels) y is the y coordinate of the top edge of the bitmap (in pixels) bmwidth is the width of the bitmap (in pixels) bmheight is the height of the bitmap (in pixels) xbm is the address of the bitmap in xmem ram see also glxputfastmap, glprintf void glxputfastmap(int left, int top, int width, int height, unsigned long bitmap); void glxgetbitmap(int x, int y, int bmwidth, int bmheight, unsigned long xbm);
92 edisplay (op7200) draws bitmap in the specified space. th e data for the bitmap are stored in xmem . this is like glxputbitmap , except that it's faster. the restriction is that the bitmap must be byte-aligned. any portion of a bitmap image or character that is outside the lcd display area will be clipped. parameters left is the upper left corner of bitm ap, must be evenly divisible by 8 top is the left top corner of the bitmap width is the width of the bitmap height is the height of the bitmap xmemptr is the address of the bitmap in xmem see also glxputbitmap, glprintf initializes the window frame structure with the border and title information. the textwindowframe function must be executed before running this function. parameters windowframe is a pointer to the window frame descriptor border is the border style: single_line ?single-line border around the text window double_line ?double-line border around the text window title is a pointer to the title: 1. if a null string is detected, then no title is written to the text menu 2. if a string is detected, then it will be written to the top of the text menu box as the centered title see also textborder, textgotoxy, textputchar, textwindowframe,textcursorlocation displays the border for a given window frame. the textborderinit function must be executed before running this function. this function will automatically adjust the text window parameters to accommodate the space taken by the text border. this adjustment will only occur once after the textborderinit function executes. parameter wptr is a pointer to the window frame descriptor see also textborderinit, textgotoxy, textputchar, textwindowframe, textcursorlocation void glxgetfastmap(int left, int top, int width, int height, unsigned long xmemptr); void textborderinit(windowframe *wptr, int border, char *title); void textborder(windowframe *wptr);
user?s manual 93 clears the entire area within the specified text window. parameter wptr is a pointer to the window frame descriptor see also textgotoxy, textprintf, textwindowframe, textcursorlocation returns the maximum number of characters that can be displayed within the text window. the tex- twindowframe function must be executed before running this function. parameter wptr is a pointer to the window frame descriptor return value the maximum number of characters that can be displayed within the text window. see also textgotoxy, textprintf, textwindowframe, textcursorlocation void textwinclear(windowframe *wptr); int textmaxchars(windowframe *wptr);
94 edisplay (op7200) 4.5.6.3 lcd screen control the sed1335f.lib library in the displays\graphic\320x240 directory provides low-level drivers for the sed1335f graphic chip. note: remember to call glinit from graphic.lib before calling any of the func- tions described in this section. enables/disables the graphic animation mode. the an imation mode is defaulted off when the graphic driver is executed. note: the animation mode is intended to be used for special effects only. raster lines may appear in your display image when this mode is turned on. parameter 0 = animation mode disabled 1 = animation mode enabled see also graphic.lib enables/disables the real-time mode for the glplotdot function. the glplotdot real-time mode is defaulted off when the graphic driver is executed. parameter 0 = real-time mode disabled 1 = real-time mode enabled see also glplotdot, graphic.lib turns the backlight on or off. the backlight is off by default when the op7200 powers up. parameter 0 = backlight off 1 = backlight on see also glsetcontrast void glanimation(int onoff); void glrealtime(int onoff); void glbacklight(int onoff);
user?s manual 95 sets the lcd display contrast. parameter contrast represents the contrast level (0 to 31 for low to high contrast), with a typical setting of 20. see also glbacklight this function is not supported at the present time. void glsetcontrast(int contrast); void gldisponoff(int onoff);
96 edisplay (op7200) 4.5.7 keypad functions the keypad9.lib library in the keypads directory provides function calls to keypad menus for the op7200 keypad. initializes keypad process assigns each key with key press and release codes, and hold and repeat ticks for auto repeat and debouncing. parameters craw is a raw key code index. 3 4 keypad matrix with raw key code index assignments (in brackets): user keypad interface cpress is a key press code an 8-bit value is returned when a key is pressed. 0 = unused. see keypaddef() for default press codes. crelease is a key release code. an 8-bit value is returned when a key is pressed. 0 = unused. ccnthold is a hold tick. how long to hold before repeating. 0 = no repeat. cspdlo is a low-speed repeat tick. how many times to repeat. 0 = none. ccntlo is a low-speed hold tick. how long to hold before going to high-speed repeat. 0 = slow only. void keyinit(void); void keyconfig(char craw, char cpress, char crelease, char ccnthold, char cspdlo, char ccntlo, char cspdhi); [0] [1] [2] [3] [4] [5] [6] [7] [8]
user?s manual 97 cspdhi is a high-speed repeat tick. how many times to repeat after low speed repeat. 0 = none. return value none. see also keyprocess, keyget, keypaddef scans and processes keypad data for key assignment, debouncing, press and release, and repeat. note: this function is also able to process an 8 8 matrix keypad. return value none see also keyconfig, keyget, keypaddef get next keypress return value the next keypress, or 0 if none see also keyconfig, keyprocess, keypaddef void keyprocess(void); char keyget(void);
98 edisplay (op7200) configures the physical layout of the keypad with the desired ascii return key codes. keypad physical mapping 3 4 where 'e' represents the enter key ?+? represents page up ?-? represents page down 'd' represents scroll down 'u' represents scroll up 'l' represents scroll left 'r' represents scroll right 's' represents space ?b? represents backspace example: do the following for the above physical vs. ascii return key codes. keyconfig ( 6,'e',0, 0, 0, 0, 0 ); keyconfig ( 3,'-',0, 0, 0, 0, 0 ); keyconfig ( 1,'+',0, 0, 0, 0, 0 ); keyconfig ( 8,'d',0, 0, 0, 0, 0 ); keyconfig ( 2,'u',0, 0, 0, 0, 0 ); keyconfig ( 5,'l',0, 0, 0, 0, 0 ); keyconfig ( 7,'r',0, 0, 0, 0, 0 ); keyconfig ( 0,'b',0, 0, 0, 0, 0 ); keyconfig ( 4,'s',0, 0, 0, 0, 0 ); characters are returned upon keypress with no repeat. return value none. see also keyconfig, keyget, keyprocess writes "1" to each row and reads the va lue. the position of a keypress is indicated by a zero value in a bit position. parameter *pckeys is the address of the value read. return value none. see also keyconfig, keyget, keypaddef, keyprocess void keypaddef(); [b] [+] [u] [-] [s] [l] [e] [r] [d] void keyscan(char *pckeys);
user?s manual 99 4.6 touchscreen (op7200 only) the gltouchscreen.lib library in the touchscreens directory allows the user to link adjacent pixel locations on the lcd to create a button. the button can then be trans- lated by the touchscreen when pressed.when x and y coordinates on the display screen are specified, x can range from 0 to 319, and y can range from 0 to 239. these numbers repre- sent pixels from the top left corner of the display. initializes the gltouchscreen.lib library, must be called at power-up before any other gltouchscreen.lib library functions can be used. this function allocates xmem sram for the storage of the button parameters. parameter maxbuttons is the number of buttons to initialize return value the unsigned long memory location of the btndata area see also btncreatetext, btncreatebitmap, btnrecall, btnstore, btndisplay, btndisplaylevel, btnclear, btnclearlevel, btnattributes, btnmsgbox, btndisplaytext, btnclearregion stores the btndata structure in xmem sram. this function is normally called by btncreatetext or by btncreatebmp . parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number of wherethe structure will be stored return value 1 when completed see also btnrecall, btninit, btncreatetext, btncreatebitmap unsigned long btninit(int maxbuttons); int btnstore(unsigned long xmemptr, int btnid);
100 edisplay (op7200) retrieves a btndata structure that was stored in xmem sram. this is function is normally called by the other functions as needed. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number to retrieve from xmem return value 1 when completed see also btnstore, btninit, btndisplay, btndisplaylevel, btnclear, btnclearlevel int btnrecall(unsigned long xmemptr, int btnid);
user?s manual 101 creates a button with a text label. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number of the button being created xstart is the coordinate of the starting horizontal pixel ystart is the coordinate of the starting vertical pixel xsize is the horizontal size of the button ysize is the vertical size of the button attribs are the button attributes: bit 0: 1 = oval shaped, 0 = square shaped bit 1 to 7 (reserved). level is the level to associate the button with (buttons with the same level can be displayed together using the function btndisplaylevel , or they can be removed together using the function btnclearlevel .) bfont is a pointer to the font descriptor text is a pointer to the text to display centered in the button return value 1 when completed example the text displayed can be multiline by inserting '\n' within the text: "hello\nfrom\nz-world" will produce see also btncreatebitmap, btninit, btndisplay, btndisplaylevel, btnclear, btnclearlevel int btncreatetext(unsigned long xmemptr, int btnid, int xstart, int ystart,int xsize, int ysize, char attribs, char level, fontinfo *bfont, char *text); hello from z-world
102 edisplay (op7200) creates a button with a bitmap. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number of the button being created xstart is the coordinate of the starting horizontal pixel ystart is the coordinate of the starting vertical pixel attribs are the button attributes: bit 0: 1 = oval shaped, 0 = square shaped bit 1: 1 = beep when pressed, 0 = disable beep bit 2 to 7 (reserved). level is the level to associate the button with (buttons with the same level can be displayed together using the function btndisplaylevel , or they can be removed together using the function btnclearlevel .) bmp is a pointer to the bitmap to use bmpwidth is the horizontal size of the bitmap bmpheight is the vertical size of the bitmap return value 1 when completed note: the button will be the bitmap size + 16 pixels , and will be centered with 8 pixels on each side, and 8 pixels each, top and bottom. see also btncreatetext, btndisplay, btnclear, btndisplaylevel, btnclearlevel, btninit int btncreatebitmap(unsigned long xmemptr, int btnid, int xstart, int ystart, char attribs, char level, unsigned long bmp, int bmpwidth, int bmpheight);
user?s manual 103 displays text on the lcd. the text will be centered automatically both horizontally and vertically. '\n' within the text will give you the capability for multiline text. for example, "hello\nfrom\nz-world" will produce parameters xstart is the coordinate of the starting horizontal pixel ystart is the coordinate of the starting vertical pixel xsize is the width of the display area in pixels ysize is the height of the display area in pixels pinfo is a pointer to the font descriptor text is a pointer to the text to be displayed return value 1 when completed see also btnmsgbox, btndisplay blanks a region of the lcd. do not use this function call to remove buttons?if you use this function to remove a button from the lcd, the button will still be enabled. instead, use btnclear or btnclearlevel to remove buttons from the lcd. parameters xstart is the pixel coordinate of the starting horizontal pixel ystart is the pixel coordinate of the starting vertical pixel xsize is the width of the display area in pixels ysize is the height of the display area in pixels return value 1 when completed see also btnclear, btnclearlevel int btndisplaytext(int xstart, int ystart, int xsize, int ysize, fontinfo *pinfo, char *text); hello from z-world int btnclearregion(int xstart, int ystart, int xsize, int ysize);
104 edisplay (op7200) displays a message or text box on the lcd. the box can be square or oval-framed, and it can be inverted. the text will be centered automatically both horizontally and vertically. '\n' within the text will give you the capability of multiline text. for example, "hello\nfrom\nz-world" will produce parameters xstart is the pixel coordinate of the starting horizontal pixel ystart is the pixel coordinate of the starting vertical pixel xsize is the width of the box in pixels ysize is the height of the box in pixels pinfo is a pointer to the font descriptor text is a pointer to the text to be displayed frame is the frame type (1 = oval, 0 = square) invert inverts the selection (0 = normal display, 1 = inverted display) return value 1 when completed see also btndisplaytext displays a predefined button on the lcd. the attributes, the text/bitmap displayed, and the location of the button are predef ined by either btncreatetext or btncreatebmp . once the button is dis- played, the touchscreen will monitor it for presses. call btnclear to remove the button. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number of the button to display return value 1 when completed see also btndisplaylevel, btnclearlevel, btnclear int btnmsgbox(int xstart, int ystart, int xsize, int ysize, fontinfo *pinfo, char *text, int frame, int invert); hello from z-world int btndisplay(unsigned long xmemptr, int btnid);
user?s manual 105 displays predefined buttons having the same level setting. the level is defined by either btncreate- text or btncreatebmp . btndisplaylevel allows you to display a group of buttons with a single function call. parameters xmemptr is the xmem address of the pointer to an array of button descriptors level is the button level to display return value 1 when completed see also btnclearlevel, btndisplay, btnclear removes a button displayed on the lcd. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btnid is the button id number of the button to remove return value 1 when completed see also btndisplaylevel, btndisplay, btnclearlevel removes a group of buttons having the same level. this function is called as many times as necessary until btn_success is returned. parameters xmemptr is the xmem address of the pointer to an array of button descriptors level is the button level to remove; use btn_all_l to remove all the buttons return value btn_success when completed, otherwise btn_pending see also btndisplaylevel, btndisplay, btnclear int btndisplaylevel(unsigned long xmemptr, char level); int btnclear(unsigned long xmemptr, int btnid); int btnclearlevel(unsigned long xmemptr, char level);
106 edisplay (op7200) sets the button attributes for the action to be taken when the button is pressed. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btn is the button id number repeatcntrl sets repeat enable/disable (0 = repeat off, 1 = repeat on) initrepeatdelay sets the initial delay in milliseconds for the repeat when the repeat is enabled repeatdelay sets the repeat delay in milliseconds between repeats buzzercntrl enables/disables the buzzer sound when the button is pressed (0 = buzzer off, 1 = buzzer on) return value 1 when completed . searches the list of buttons in use for a button that matches the x,y coordinates from the touchscreen. parameters xmemptr is the xmem address of the pointer to an array of button descriptors x is the x coordinate of the location on the touchscreen y is the y coordinate of the location on the touchscreen return value the button id of the button corresponding to the button being pressed. if no such button is found, the function returns a negative number. see also btnverifyxy, btnget int btnattributes(unsigned long xmemptr, int btn, int repeatcntrl,int initrepeatdelay, int repeatdelay, int buzzercntrl); int btnsearchxy(unsigned long xmemptr, int x, int y);
user?s manual 107 searches the list of buttons in use for a button that matches the x,y coordinates from the touchscreen. parameters xmemptr is the xmem address of the pointer to an array of button descriptors btn is the button id code of the button to be verified x is the x coordinate of the location on the touchscreen y is the y coordinate of the location on the touchscreen return value the button id of the button corresponding to the button being verified. if the button is not the correct button, the function returns a negative number. see also btnsearchxy, btnget checks the touchscreen x,y coordinates against a given set of buttons being displayed to look for a match. if a match is found, then the button id code for the button will be returned. parameters xmemptr is the xmem address of the pointer to an array of button descriptors return value the button id code of the button corresponding to the button being pressed. if no such button is found, the function returns a negative number. see also btnsearchxy, btnverifyxy int btnverifyxy(unsigned long xmemptr, int btn, int x, int y); int btnget(unsigned long xmemptr);
108 edisplay (op7200) the ts_r4096.lib library in the touchscreens directory provides low-level touch- screen function calls. calibrates the touchscreen as a linear function using the two sets of x,y coordinates provided. gain and offset constants are calculated and placed into the global table _adccalibts . parameters x1 is the x coordinate of the upper left-hand corner of the touchscreen y1 is the y coordinate of the upper left-hand corner of the touchscreen x2 is the x coordinate of the lower right-hand corner of the touchscreen y2 is the y coordinate of the lower right-hand corner of the touchscreen return value 0 if sucessful -1 if not able to make calibration constants see also tscalibeerd, tscalibeewr, tsxyvector, brdinit reads the calibration constants, gain, and offset from the simulated eeprom in flash. the constants are stored in the top 1k of the reserved user block memory area. use the sample program userblockinfor.c in samples\op7200 to get the addresses reserved for the calibration data constants and the addresses available for use by your application program. return value 0 if sucessful -1 if invalid address or range see also tscalib, tscalibeewr, tsxyvector, brdinit writes the calibration constants, gain, and offset to the simulated eeprom in flash. the constants are stored in the top 1k of the reserved user block memory area. use the sample program userblockinfor.c in samples\op7200 to get the addresses reserved for the calibration data constants and the addresses available for use by your application program. return value 0 if sucessful -1 if invalid address or range see also tscalib, tscalibeerd, tsxyvector, brdinit int tscalib(int x1, int y1, int x2, int y2); int tscalibeerd(void); int tscalibeewr(void);
user?s manual 109 reads the current x,y coordinates of the touchscreen parameters xkey is a pointer to the x coordinate ykey is a pointer to the y coordinate mode is the mode of operation: 0 ( raw_mode )?raw mode, returns touchscreen x, y coordinate's true raw data value 1 ( cal_mode )?calibration mode, returns touchscreen x, y coordinates as normalized data values to match the lcd display resolution see also tsactive, tsscanstate, tsxybuffer, brdinit this function returns the status of whether the touchscreen is being pressed or touched. return value 0?touchscreen is not being pressed 1?touchscreen is being pressed see also tsxyvector, tsscanstate, tsxybuffer, brdinit this function processes the current state of the to uchscreen. the results can then be read with the tsxybuffer function, which will return one of the following. 1. the current x,y location of where the touchscreen is being pressed 2. a value indicating that the touchscreen press has ended 3. a value of -1 to indicate no activity has occurred note: when this function is called, the information should be processed before calling this function again to avoid losing the information. see also tsxyvector, tsactive, tsxybuffer, brdinit void tsxyvector(int *xkey, int *ykey, int mode); int tsactive(void); void tsscanstate(void);
110 edisplay (op7200) this function returns either the x,y coordinates or the touchscreen btn_release status code that was processed by the tsscanstate function. return value the x coordinate is returned in the msb, and the y coordinate is returned in the lsb of the long integer value. see also tsxyvector, tsactive, tsscanstate, brdinit long tsxybuffer(void);
user?s manual 111 4.7 rabbitnet port the function calls described in this section are used to configure the op7200 for use with rabbitnet peripheral boards. the user?s manua l for the specific peripheral board you are using contains additional function calls related to the rabbitnet protocol and the individ- ual peripheral board. add the following lines at the start of your program. #define rn_max_dev 10 // max number of devices #define rn_max_data 16 // max number of data bytes in any transaction #define rn_max_port 1 // max number of serial ports set the following bits in rnstatusabort to abort transmitting data after the status byte is returned. this does not affect the status byte and still can be interpreted. set any bit com- bination to abort: bit 7?device busy is hard-coded into driver bit 5?identifies router or slave bits 4,3,2?peripheral-board-specific bits bit 1?command rejected bit 0?watchdog timeout #define rnstatusabort 0x80 // hard-coded driver default to abort if the peripheral board is busy provides rn_init() with the serial port control info rmation needed for op7200 series controllers. return value none. deactivates the op7200 rabbitnet port as a clocked serial port and restores the rs-485 driver for rs-485 communication. this call is also used by rn_init() . parameters portnum = 0 return value none void rn_sp_info(); void rn_sp_close(int port);
112 edisplay (op7200) this is a macro that enables or asserts the op720 0 rabbitnet port select prior to data transfer. parameters portnum = 0 return value none this is a macro that disables or deasserts the op7200 rabbitnet port select to invalidate data transfer. parameters portnum = 0 return value none. void rn_sp_enable(int portnum); void rn_sp_disable(int portnum);
user?s manual 113 5. u sing the tcp/ip f eatures chapter 5 discusses using the tc p/ip features on the op7200 boards. 5.1 tcp/ip connections before proceeding you will need to have the following items.  if you don?t have an ethernet connection, you will need to install a 10base-t ethernet card (available from your favorite computer supplier) in your pc.  two rj-45 straight-through ethernet cables and a hub, or an rj-45 crossover ethernet cable. the ethernet cables and ethernet hub are avai lable from rabbit in a tcp/ip tool kit. more information is available at www.rabbit.com . 1. connect the ac adapter and the programmi ng cable as shown in chapter 2, ?getting started.? 2. ethernet connections  if you do not have access to an ethernet netw ork, use a crossover ethernet cable to con- nect the op7200 to a pc that at least has a 10base-t ethernet card.  if you have an ethernet connection, use a straight-through ethernet cable to establish an ethernet connection to the op7200 from an ethernet hub. these connections are shown in figure 22. figure 22. ethernet connections op7200 user?s pc ethernet crossover cable direct connection (network of 2 computers) op7200 hub ethernet cables to additional network elements direct connection using a hub board board
114 edisplay (op7200) 3. apply power plug in the ac adapter. the op7200 is now ready to be used. note: a hardware reset is accomplished by unplugging the ac adapter, then plug- ging it back in, or by momentarily grounding the board reset input at pin 5 on screw- terminal header j10. when the prog connector of the programming cable connects the op7200 to your pc, and dynamic c is running, a reset occurs when you press . the green lnk light on the op7200 rabbitcore module is on when the op7200 is prop- erly connected either to an ethernet hub or to an active ethernet card. the orange act light flashes each time a packet is received.
user?s manual 115 5.2 tcp/ip sample programs we have provided a number of sample programs demonstrating various uses of tcp/ip for networking embedded systems. these programs require that you connect your pc and the op7200 together on the same network. this ne twork can be a local private network (pre- ferred for initial experimentation and de bugging), or a connection via the internet. 5.2.1 how to set ip addresses in the sample programs most of the sample programs such as shown in the example below use macros to define the ip address assigned to the board and the ip a ddress of the gateway, if there is a gateway. #define my_ip_address "10.10.6.170" #define my_netmask "255.255.255.0" #define my_gateway "10.10.6.1" #define my_nameserver "10.10.6.1" in order to do a direct connection, the follo wing ip addresses can be used for the op7200: #define my_ip_address "10.1.1.2" #define my_netmask "255.255.255.0" // #define my_gateway "10.10.6.1" // #define my_nameserver "10.10.6.1" in this case, the gateway and nameserver are not used, and are commented out. the ip address of the board is defined to be 10.1.1.2 . the ip address of you pc can be defined as 10.1.1.1 . ip addresses after dynamic c 7.30 with the introduction of dynamic c 7.30 we have taken steps to make it easier to run many of our sample programs. instead of the my_ip_address and other macros, you will see a tcpconfig macro. this macro tells dynamic c to select your configuration from a list of default configurati ons. you will have three choices when you encounter a sample program with the tcpconfig macro. 1. you can replace the tcpconfig macro with individual my_ip_address , my_netmask , my_gateway , and my_nameserver macros in each program. 2. you can leave tcpconfig at the usual default of 1, which will set the ip configurations to 10.10.6.100 , the netmask to 255.255.255.0 , and the nameserver and gateway to 10.10.6.1 . if you would like to change the default values, for example, to use an ip address of 10.1.1.2 for the rcm3200 board, and 10.1.1.1 for your pc, you can edit the values in the section that directly follo ws the ?general configuration? comment in the tcp_config.lib library. you will find this library in the lib\tcpip directory. 3. you can create a custom_config.lib library and use a tcpconfig value greater than 100. instructions for doing this are at the beginning of the tcp_config.lib file. there are some other ?standard? configurations for tcpconfig that let you select differ- ent features such as dhcp. their valu es are documented at the top of the tcp_config.lib library. more information is available in the dynamic c tcp/ip user?s manual .
116 edisplay (op7200) 5.2.2 how to set up your computer for direct connect follow these instructions to set up your pc or notebook. check with your administrator if you are unable to change the settings as desc ribed here since you may need administrator privileges. the instructions are specifically for windows 2000, but the interface is similar for other versions of windows. tip: if you are using a pc that is already on a network, you will disconnect the pc from that network to run these sample programs. write down the existing settings before changing them to facilitate restoring them when you are finished with the sample pro- grams and are ready to reconnect your pc to the network. 1. go to the control panel ( start > settings > control panel ), and double-click the network icon. 2. select the network interface card used for the ethernet interface you intend to use (e.g., tcp/ip xircom credit card network adapter ) and click on the ?properties? button. depending on which version of windows your pc is running, you may have to select the ?local area connection? first, and then click on the ?properties? button to bring up the ethernet interface dialog. then ?confi gure? your interface card for a ?10base-t half-duplex? or an ?auto-negotiati on? connection on the ?advanced? tab. note: your network interface card will likely have a different name. 3. now select the ip address tab, and check specify an ip address , or select tcp/ip and click on ?properties? to assign an ip address to your computer (this will disable ?obtain an ip address automatically?): ip address : 10.10.6.101 netmask : 255.255.255.0 default gateway : 10.10.6.1 4. click or to exit the various dialog boxes. op7200 user?s pc ethernet crossover cable ip 10.10.6.101 netmask 255.255.255.0 direct connection pc to op7200 board board
user?s manual 117 5.2.3 run the pingme.c demo connect the crossover cable from your computer?s ethernet port to the op7200?s rj-45 ethernet connector. open this sample program from the samples\tcpip\icmp folder, compile the program, and start it running under dynamic c. when the program starts run- ning, the green lnk light on the op7200 should be on to indicate an ethernet connection is made. (note: if the lnk light does not light, you may not have a crossover cable, or if you are using a hub perhaps the power is off on the hub.) the next step is to ping the board from your pc. this can be done by bringing up the ms- dos window and running the ping program: ping 10.10.6.100 or by start > run and typing the command ping 10.10.6.100 notice that the orange act light flashes on the op7200 while the ping is taking place, and indicates the transfer of data. the ping rout ine will ping the board four times and write a summary message on the scre en describing the operation.
118 edisplay (op7200) 5.2.4 running more demo programs with a direct connection the sample programs discussed in this se ction use the demonstration board from the op7200 tool kit to illustrate their operation. appendix c, ?demonstration board con- nections,? contains diagrams of typica l connections between the op7200 and the demon- stration board used to run these sample programs. the program flash_xml.c ( samples\op7200\tcpip\ ) runs a web server that has a web page with a macromedia flash movie. you will need the macromedia flash plug-in installed on your browser to use this sample program. the program smptp.c ( samples\op7200\tcpip\ ) uses the smtp library to send an e-mail when a switch on the demonstration board is pressed. the program ssi.c ( samples\op7200\tcpip\ ) demonstrates how to make the op7200 a web server. this program allows you to turn the leds on an attached demon- stration board from the tool kit on and off from a remote web browser. led1 and led2 on the demonstration board will match those on the web page. as long as you have not modified the tcpconfig 1 macro in the sample program, enter the following server address in your web browser to bring up th e web page served by the sample program. http://10.10.6.100 otherwise use the tcp/ip settings you entered in the tcp_config.lib library. the sample program telnet.c ( samples\op7200\tcpip\ ) allows you to communi- cate with the op7200 using the telnet protocol. this program takes anything that comes in on a port and sends it out serial port b. it us es digital input in0 to indicate that the tcp/ip connection should be closed and high-current output out0 to indicate that there is an active connection.you may change the digital input and output to suit your application needs. follow the instructions included with the sample program. run the telnet program on your pc ( start > run telnet 10.10.6.100 ). as long as you have not modified the tcpconfig 1 macro in the sample program, the ip address is 10.10.6.100 as shown; otherwise use the tcp/ip settings you entered in the tcp_config.lib library. each character you type will be printed in dynamic c's stdio window, indicating that the board is receiving the char acters typed via tcp/ip.
user?s manual 119 5.3 where do i go from here? note: if you purchased your op7200 through a distributor or rabbit partner, contact the distributor or partner first for technical support. if there are any problems at this point:  use the dynamic c help menu to get further assistance with dynamic c.  check the rabbit technical bulletin board and forums at www.rabbit.com/support/bb/ and at www.rabbit.com/forums/ .  use the technical support e-mail form at www.rabbit.com/support/ . if the sample programs ran fine, you are now ready to go on. additional sample programs are described in the dynamic c tcp/ip user?s manual . refer to the dynamic c tcp/ip user?s manual to develop your own applications. an introduction to tcp/ip provides background information on tcp/ip, and is available on our web site .
120 edisplay (op7200)
user?s manual 121 6. i nstallation , m ounting , and c are g uidelines chapter 6 describes some considerations for mounting the op7200 in a panel, and includes detailed mounting instructions, protective grounding instructions , and care guidelines for clean- ing the screen overlay. 6.1 grounding caution: many of the op7200 ics are sensitive to static. use extra caution when han- dling units in high-static areas. to meet electromagnetic compatibility requirem ents, and in particular to prevent misoper- ation or damage from electrostatic discharges, the bezel must be connected to a protective ground via a low-impedance path. a protective building ground is recommended once the op7200 is installed at the location where it will be used. in addition to providi ng protection against an unexpected electric shock, the connection to building ground also mitigates any problems from external elec- trostatic discharges and transien ts, and dampens any rf emissions. the metal case is already connect ed electrically to the bezel, and so does not require a sep- arate ground connection. the recommended way to connect an op7200 to a building ground is to mount the unit in a metal panel that is already grounded. use a wire with a size of at least 20awg (0.5 mm 2 ), preferably stranded, to establish a connection between one of the screws holding the back cover in place and the protective building gr ound. this wire should be as short as possible to keep its impedance low. there is an electrical connection between the op7200 bezel/casing and the connections marked gnd or agnd on the op7200 headers. this connection is the return for the i/o signals, and should not be used for a protective ground connection.
122 edisplay (op7200) 6.2 installation guidelines when possible, following these guidelines when mounting an op7200. 1. leave sufficient ventilation space, at least 1" (2 cm) around the unit on all sides. 2. do not install the op7200 directly above ma chinery that radiates a lot of heat (for example, heaters, transforme rs, and high-power resistors). 3. leave at least 8" (20 cm) distance from electric power lines and even more from high- voltage devices. 4. when installing the op7200 near devices with strong electrical or magnetic fields (such as solenoids), allow a least 3" (8 cm), more if necessary. the op7200 has strong environmental resistan ce and high reliability, but you can maxi- mize system reliability by avoiding or elimina ting the following conditions at the installa- tion site.  abrupt temperature changes and condensation  ambient temperatures exceeding a range of 0c to 50c  relative humidity exceeding a range of 20% to 70%  strong magnetism or high voltage  corrosive gasses  direct vibration or shock  excessive iron dust or salt  spray from harsh chemicals
user?s manual 123 6.3 mounting instructions the op7200 comes with a gasket attached to the bezel. when properly mounted in a panel, the op7200 bezel/gasket are designed to meet nema 4 specifications for water resistance. since the op7200 employs an lcd display, the viewing angle must be considered when mounting the display. the viewing angle is af fected by the software-controlled contrast. install the op7200 at a height and angle that makes it easy for the operator to see the screen. 6.3.1 bezel-mount installation this section describes and il lustrates how to bezel-mount the op7200. follow these steps for bezel-mount installation. 1. cut a mounting hole in the mounting panel in accordance with the recommended dimen- sions in figure 23, then use the bezel faceplate to mount the op7200 onto the panel. figure 23. recommended cutout dimensions ; d e ; d e !+! ; d e  8 ; d e ; de
124 edisplay (op7200) 2. remove the op7200 back cover. set the screws and back cover aside since the back cover will be re-attached after the op7200 is inserted through the cutout. 3. carefully insert the op7200. 4. fasten the unit to the panel with the back c over and the four 4-40 screws that attach the back cover to the op7200. if your panel is more than 0.1" (2.5 mm) thick, you will need to supply longer 4-40 screws. figure 24. op7200 mounted in panel (rear view) carefully tighten the screws until the gasket is compressed by the bezel faceplate. do not tighten each screw fully before moving on to the next screw. apply only one or two turns to each screw in sequence until all are tightened manually as far as they can be so that the gasket is compressed by the bezel faceplate. +7"## 8 94     







 
 
 
 
 


 







   


 







 


 







                                                                 $          
                   
             
user?s manual 125 6.4 care guidelines if it becomes necessary to clean the screen overlay, use a mild detergent, then rinse with lukewarm water using a clean sponge or a so ft cloth. dry thoroughly with a chamois or a moist cellulose sponge to prevent water spots. do not use abrasives, which will scratch the hard coating on the overlay. fresh paint splashes, grease, and smeared glazing compounds can be removed by rubbing gently with a grade of vm&p naphta, windex ? , or isopropyl alcohol. never use gasoline, acetone, carbon tetrachloride, or highly alkaline cleaners. rinse afterwards with lukewarm water as described above. cleaning is not recommended when the op7200 is exposed to the hot sun or elevated tem- peratures.
126 edisplay (op7200)
user?s manual 127 a ppendix a. s pecifications appendix a provides the specifications for the op7200.
128 edisplay (op7200) a.1 electrical and mechanical specifications figure a-1 shows the mechanical dimensions for the op7200. figure a-1. op7200 dimensions note: all measurements are in inches followed by millimeters enclosed in parentheses. ; de ; d e ; de ; de ; d ;e ; d e ; de ; de ; d e ;  d e ;  d e
user?s manual 129 table a-1 lists the electrical, mechanical, a nd environmental specifications for the op7200. table a-1. op7200 specifications feature op7200 op7210 microprocessor rabbit ? 2000 at 22.1 mhz ethernet port 10/100-compatible with 10base-t interface, rj-45 flash memory 256k sram 128k backup battery socketed 3 v lithium coin type, 265 mah keypad/display ? vga (320 240 pixels) with programmable white led backlight, black on white display, transflective fstn lcd, 6 o?clock viewing angle; 9-key keypad touchscreen 4096 4096 resistive touchscreen no leds 4: power on, microprocessor error, ethernet link, ethernet activity digital inputs 19: protected to 36 v dc 16: protected to 36 v dc digital outputs 8: individually configurable in soft ware to sink up to 350 ma each, 36 v dc max., or source up to 250 ma each, 40 v dc max. analog inputs 8 single-ended or 4 differential, 200 k ? input impedance, 1.5 ksamples/s sampling rate  software-controlled ranges: 0?1 v, 2 v, 5 v 10 v, 20 v dc (11-bit single-ended, 12-bit dif- ferential) none connectors four 12-position screw-terminal headers, 0.1" pitch three 12-position screw-terminal headers, 0.1" pitch serial ports 4 serial ports:  two rs-232 or one rs-232 (with cts/rts)  one rs-485 with onboard network termination and bias resistors or one rs-422 spi master port  one 5 v cmos-compatible programming port serial rate max. burst rate = clk/32, max. sustained rate = clk/64 real-time clock yes timers five 8-bit timers (four cascadable from the first), one 10-bit timer with 2 match registers watchdog/supervisor yes power 9?40 v dc or 22?26 v ac, 4 w max. temperature operating range: -10c to +65c storage range: ?30c to +80c humidity 20% to 70%, noncondensing unit size 4.41" 5.67" 1.70" (112 mm 144 mm 43 mm)
130 edisplay (op7200) a.1.1 physical mounting figure a-2 shows position information to assist with interfacing other boards with the op7200. figure a-2. user board footprint for op7200    







 
 
 
 
 


 







                                  


 







            !    "                  


 







                                            #   #                                                    $                 #                                       %&&'()                              !   " " " "      #         !       "          !                        " !"# $  % ;  d ;e ; d ;e ; de ; d e ;  d;e ; d;e ;  d;e ;  d;e ;  de ;  d; e ; d ;e
user?s manual 131 a.2 conformal coating the areas around the crystal oscillator and the battery backup circuit on the op7200?s rabbitcore module have had the dow corni ng silicone-based 1-2620 conformal coating applied. the conformally coated areas are shown in figure a-3. the conformal coating protects these high-impedance circuits from th e effects of moisture and contaminants over time, and helps to maintain the accuracy of the real-time clock. figure a-3. op7200?s rabbitcore module areas receiving conformal coating any components in the conformally coated area may be replaced using standard soldering procedures for surface-mounted components. a new conformal coating should then be applied to offer continuing protection against the effects of moisture and contaminants. note: for more information on conformal coatings, refer to rabbit technical note 303, conformal coatings .    







 
 
 
 
 


 







                                  


 







            !    "                  


 







                                            #   #                                                    $                 #                                       %&&'()                              !   " " " "      #         !       "          !                        " !"# $  % 2 )   
132 edisplay (op7200) a.3 jumper configurations figure a-4 shows the header and jumper locations used to configure the various op7200 options. figure a-4. location of op7200 configurable positions (rabbitcore module is not shown) table a-2 lists the configuration options. 0 ? surface mount resistors are used for all the positions except jp10 and j8, which use standard pluggable jumpers. table a-2. op7200 jumper configurations header description pins connected factory default jp1 in16?in18 1?2 pulled up to vcc 2?3 pulled down jp2 in00?in07 1?2 pulled up to vcc 2?3 pulled down                     %&&'()  
user?s manual 133 jp3 in8?in15 1?2 pulled up to vcc 2?3 pulled down jp4 ain0?ain1 1?2 tied to 2.048 v 2?3 tied to analog ground jp5 ain2?ain3 1?2 tied to 2.048 v 2?3 tied to analog ground jp6 ain4?ain5 1?2 tied to 2.048 v 2?3 tied to analog ground jp7 ain6?ain7 1?2 tied to 2.048 v 2?3 tied to analog ground jp8 analog reference voltage 1?2 based on a/d converter chip 2?3 based on ratiometric or ext. reference jp9 lcd controller i/o bit va16 1?2 va16 not used 2?3 va16 used?additional 64k video sram jp10 rabbitnet master/slave control 1?2 reserved for future use 3?4 reserved for future use n.c. op7200 in ?master? role jp11 lcd oscillator 1?2 2?3 osc/4 jp12 lcd oscillator 1?2 2?3 osc/4 jp13 board id bit 0 (lsb) 1?2 pulled up to vcc 2?3 pulled down table a-2. op7200 jumper configurations (continued) header description pins connected factory default
134 edisplay (op7200) note: jumper positions jp11?jp16 were introduced in january, 2006, to accommodate a new lcd controller chip. see section 4.1.2.1 for additional information. jp14 board id bit 1 1?2 pulled up to vcc 2?3 pulled down jp15 board id bit 2 1?2 pulled up to vcc 2?3 pulled down jp16 board id bit 3 (msb) 1?2 pulled up to vcc 2?3 pulled down j8 rs-485 bias and termination resistors 1?2 4?6 bias and termination resistors connected 1?3 5?6 bias and termination resistors not connected (parking position for jumpers) ? out0?out7 r64 pulled up to vcc r65 pulled up to +k r62 pulled down ? in15 or vcc on j10:4 ? in15 on j10:4 r71 vcc on j10:4 table a-2. op7200 jumper configurations (continued) header description pins connected factory default
user?s manual 135 a.4 use of rabbit 2000 parallel ports figure a-5 shows the rabbit 2000 parallel ports. figure a-5. op7200 rabbit-based subsystems table a-3 lists the rabbit 2000 parallel ports and their use in the op7200. table a-3. use of rabbit 2000 parallel ports port i/o signal notes pa0 input in00 pulled up to vcc pa1 input in01 pulled up to vcc pa2 input in02 pulled up to vcc pa3 input in03 pulled up to vcc pa4 input in04 pulled up to vcc pa5 input in05 pulled up to vcc pa6 input in06 pulled up to vcc pa7 input in07 pulled up to vcc pb0 input ss_clk pulled up to vcc pb1 input programming port clock pulled up to vcc pb2 input ss_cs pulled up to vcc pb3 input ss_mode pulled up to vcc pb4 input touchscreen status pulled up to vcc pb5 input adc_sd0 pulled up to vcc pb6 output not used high pb7 output microprocessor bad led high ,)  ,) > ?  #6'$)"!,) >@ ,)  ?  )"!,) >@ ,)    0
 0  0
   0    >   " "# 77)### 41, ),! " '$7,3 ;9)# !,'- ,(!) !"2,) "!9!,'- % >"'->" )6 ,) !"#$ ,)  ?  )"!,) #a @ ),3)"993 ,) ?)"!,) @  $) ,) %#'=41 
&8'(2'&
-162%.-
#
+5&45&- 


*+('
+5&45&  0
 0
b 

*+('
1245&- 0
 0
    ! : "###
136 edisplay (op7200) pc0 output rts/txd rs-232 serial port d inactive high pc1 input cts/rxd rs-232 inactive high pc2 output txc rs-232 serial port c inactive high pc3 input rxc rs-232 inactive high pc4 output realtek reset initialized by sock_init pc5 input realtek int0 pulled up to vcc pc6 output txa programming port serial port a inactive high pc7 input rxa programming port inactive high pd0 input realtek clk initialized by sock_init pd1 input realtek sd0 initialized by sock_init pd2 output not used high pd3 output adc and touchscreen chip select high pd4 output atxb rs-485 serial port b inactive high pd5 input arxb rs-485 inactive high pd6 output not used high pd7 output not used high pe0 output adc and touchscreen serial clock high pe1 output adc and touchscreen data in high pe2 output realtek iorb strobe initialized by sock_init pe3 output realtek sdi line initialized by sock_init pe4 output cpld chip select 0 high pe5 output cpld chip select 1 high pe6 output realtek i/o write initialized by sock_init pe7 output sed1335 chip select high table a-3. use of rabbit 2000 parallel ports (continued) port i/o signal notes
user?s manual 137 a.5 i/o address assignments table a-4 lists the external i/o address assignments. table a-4. display and keypad i/o addresses external address signal name function pbdr (write) pb7 port pin 0 = led off, 1 = led on pb7-up_good lcd indicator pbdr (read) pb5 serial data from device pb5_adc_sdo data from a/d converter or touchscreen pddr (write) pd3 0 = adc chip selected, 1 = touchscreen chip selected /pd3_adc_cs cs for a/d converter or touchscreen pedr (write) pe0 clock data to device on 0/1 trans. pe0_adc_sk clk for a/d converter or touchscreen pedr (write) pe1 serial data to the device pe1_adc_sdi data to a/d converter or touchscreen pbdr (read) pb4 0 = touchscreen active, 1 = touchscreen not active /pb4_tsc_pirq touchscreen status padr (read) pa0?pa7 port pins in0?in7 digital inputs in0?in7 0x8000 (read) d0?d7 data lines in8?in15 digital inputs in8?in15 0x8000?0x8007 (write) 0 = driver enabled, 1 = driver disabled sink0?sink7 sinking driver control lines 0x8008?0x800f (write) 0 = driver enabled, 1 = driver disabled source0? source7 sourcing driver control lines 0xa000 (read) data line d5, 0 = key active, 1 = no active keys k0 keypad row 0 0xa000 (read) data line d6, 0 = key active, 1 = no active keys k1 keypad row 1 0xa000 (read) data line d7, 0 = key active, 1 = no active keys k2 keypad row 2 0xa000 (write) 1 = assert key scan line, 0 = deassert key scan line /kb-s0 keypad column 0 0xa001 (write) 1 = assert key scan line, 0 = deassert key scan line /kb-s1 keypad column 1 0xa002 (write) 1 = assert key scan line, 0 = deassert key scan line /kb-s2 keypad column 2 0xa003 (write) 1 = assert key scan line, 0 = deassert key scan line /kb-s3 keypad column 3
138 edisplay (op7200) 0xa004 (write) 1 = backlight on, 0 = backlight off bklt-on backlight on/off control 0xa005 (write) 1 = xmit on, 0 = xmit off rs-485en rs-485 transmitter control 0xa006 (write) 1 = buzzer on, 0 = buzzer off alarm buzzer on/off control 0xa007 (write) 1 = assert lcd address a16, 0 = deassert lcd address a16 va16 lcd address line a16 0xa008 (write) 1 = assert x9013 chip select, 0 = deassert x9013 chip select /cs contrast control chip select 0xa009 (write) 1 = set x9013 to count up, 0 = set x9013 to count down u_d contrast control count mode 0xa00a (write) increment x9013 counter when accessed, data = don?t care inc contrast control clk line 0xa00b?0xa00f reserved not used 0xe000 (w/r) command data byte /pe7-lcdm-cs sed1335 command register 0xe001 (w/r) data register byte /pe7-lcdm-cs sed1335 data register table a-4. display and keypad i/o addresses (continued) external address signal name function
user?s manual 139 a ppendix b. p ower s upply appendix b describes the power circuitry provided on the op7200. b.1 power supplies power is supplied to the op7200 via pins 1 and 2 of screw-terminal header j3. the op7200 is protected against reverse polarity by a full -wave bridge rectifier as shown in figure b-1. the full-wave bridge rectifier also allows the op7200 to be powered from 24 v ac. figure b-1. op7200 power supply the input voltage range is from 9 v to 40 v dc. a switching power regulator is used to provide a vcc of +5 v for the op7200 logic circu its. vcc is can be made accessible to the user by installing a 0 ? resistor at r71. vcc will then be available instead of digital input in15 on pin 4 of screw-terminal header j10. the op7200 can alternatively be powered by 24 v ac. in this case the full-wave bridge rectifier produces approximately 30 v dc at the input of the switching regulator. although a significant drop will be measured at the input to the switching regulator, the voltage will never drop below +9 v dc. as long as the minimum input level is maintained at the input to the regulator, vcc will be held at +5 v dc. there is provision on the printed-circuit board fo r a transorb to be installed at tvs1 in parallel with c49 to provide suppression for positive noise pulses above 51 v. this part is only needed when the op7200 will be used in industrial environments where a clean source of power cannot be guaranteed, and is not part of the normal factory build. >
  
f? 
f? " $// #    
fa              >a
>
"# $ #   > > $
140 edisplay (op7200) b.1.1 power for analog circuits power to the analog circuits is provided by way of a single-stage low-pass filter, which isolates the analog section from digital noise generated by the other components. the ana- log power voltage +v powers the a/d converter chip, the touchscreen controller, and the reference circuit. the maximum current draw on +v is less than 10 ma. +v is not acces- sible to the user. b.1.2 grounds there are three grounds, one digital ground on scre w-terminal headers j3 (pin 12) and j10 (pin 12), and an analog ground on screw-terminal header j2 (pin 12). the digital and ana- log grounds share a single split ground plane on the printed-circuit board. keeping the grounds separate isolates the noise of the di gital section from the analog circuits, provid- ing for improved performance of the a/d conve rter chip and the touchscreen controller. the analog ground is connected at a single poi nt to the digital ground by a single copper bridge to eliminate the possibility of gr ound loops. analog ground should be used as the return path for inputs connected to the a/d c onverter chip via pins 4?11 of screw-terminal header j2. b.1.3 rabbitnet power supplies there is no provision on the op7200 to supply power to any rabbitnet peripheral cards that together with the op7200 make up a rabbitnet lan.
user?s manual 141 b.2 batteries and external battery connections the sram and the real-time clock have batte ry backup. power to the sram and the real- time clock (vram) on the op7200?s rabbitc ore module is provided by two different sources, depending on whether the main part of the op7200 is powered or not. when the op7200 is powered normally, and vcc is within operating limits, the sram and the real- time clock are powered from vcc. if power to the board is lost or falls below 4.63 v, the vram and real-time clock power will come fr om the battery. the reset generator circuit controls the source of power by way of its /reset output signal. a replaceable 265 mah lithium battery provides power to the real-time clock and sram when external power is removed from the circuit board. the drain on the battery is typically less than 10 a when there is no external power applied to the op7200, and so the expected shelf life of the battery is the drain on the battery is typically less than 4 a when external power is applied, and so the expected battery in-service life is b.2.1 replacing the backup battery the battery is user-replaceable, and is fitted in a battery holder. to replace the battery, lift up on the spring clip and slide out the old battery. use only a panasonic br2330 or equiv- alent replacement battery, and insert it into the battery holder with the + side facing up. note: the sram contents and the real-time clock settings will be lost if the battery is replaced with no power applied to the op7200. exercise care if you replace the battery while external power is applied to the op7200. caution: there is an explosion danger if the battery is short-circuited, recharged, or replaced incorrectly. replace the battery only with the same type or an equivalent type recommended by the battery manufacturer. dispose of used batteries according to the battery manufacturer?s instructions. 265 mah 10 a ----------------------- - 3.0 years. = 265 mah 4 a ------------------------ 7 . 5 y e a r s . =
142 edisplay (op7200) b.2.2 external battery as an alternative to preserving the sram contents and the real-time clock settings while changing the backup battery, you may connect an external battery temporarily at header j7. the pins on header j7 have ground on the ends and positive in the center to allow the external battery to be connected without the potential of reversing its polarity. connect the positive terminal of the external battery to pin 2 and th e negative terminal to either pin 1 or pin 3 of header j7. the onboard battery does not have to be remove d as it is protected against overvoltage by resistors r80?r81. by having both batteries conne cted, either can be replaced from time to time without losing the data stored in the sram and the real-time clock. the external battery should be no more than 6.3 v. figure b-2. op7200 external battery connections $% $/# $" $0 $7 %&&'()                  !   " " " "      #         !       "          !                        " !"# $  % c&'(2%. %&&'()  $   
9   
user?s manual 143 b.2.3 battery-backup circuit figure b-3 shows the battery-backup circuit located on the op7200?s rabbitcore module. figure b-3. op7200 backup battery circuit the battery-backup circuit serves three purposes:  it reduces the battery voltage to the sram and to the real-time clock, thereby limiting the current consumed by the real-time clock and lengthening the battery life.  it ensures that current can flow only out of the battery to prevent charging the battery.  a voltage, vosc, is supplied to u6, which keeps the 32.768 khz oscillator working when the voltage begins to drop. vram and vcc are nearly equal (<100 mv, t ypically 10 mv) when power is supplied to the op7200.   
9  $ $   
9 
9    $  $//
9   
9  $       
2?  
2?
144 edisplay (op7200) b.2.4 power to vram switch the vram switch on the op7200?s rabbitcore module, shown in figure b-4, allows the battery backup to provide power when the external power goes off. the switch provides an isolation between vcc and the battery when vcc goes low. this prevents the vcc line from draining the battery. figure b-4. vram switch field-effect transistor q5 is needed to pr ovide a very small voltage drop between vcc and vram (<100 mv, typically 10 mv) so that the board components powered by vcc will not have a significantly different voltage than vram. when the op7200 is not in reset, the /res_out line will be high. this turns on q2, caus- ing its collector to go low. this turns on q5, allowing vram to nearly equal vcc. when the op7200 is in reset, the /res_out line will go low. this turns off q2 and q5, providing an isolation between vcc and vram. b.2.5 reset generator the op7200?s rabbitcore module uses a reset generator on the module, u1, to reset the rabbit 2000 microprocessor when the voltage dr ops below the voltage necessary for reli- able operation. the reset occurs be tween 4.50 v and 4.75 v, typically 4.63 v. ?$        $ $   
9  
 b" 
9 
user?s manual 145 b.3 chip select circuit figure b-5 shows a schematic of the chip se lect circuit on the op7200?s rabbitcore module. figure b-5. chip select circuit the current drain on the battery in a battery-backed circuit must be kept at a minimum. when the op7200 is not powered, the battery keeps the sram memory contents and the real-time clock (rtc) going. the sram has a powerdown mode that greatly reduces power consumption. this powerdown mode is activated by raising the chip select (cs) signal line. normally the sram requires vcc to operate. however, only 2 v is required for data retention in powerdown mode. thus, when power is removed from the circuit, the battery voltage needs to be provided to bot h the sram power pin and to the cs signal line. the cs control circuit accomplishes this task for the sram?s chip select signal line. in a powered-up condition, the cs control circui t must allow the processor?s chip select signal /cs1 to control the sram?s cs signa l /csram. so, with power applied, /csram must be the same signal as /cs1, and with power removed, /csram must be held high (but only needs to be battery voltage high). q3 and q4 are mosfet transistors with com- plementary polarity. they are both turned on when power is applied to the circuit. they allow the cs signal to pass from the processor to the sram so that the processor can peri- odically access the sram. when power is remove d from the circuit, the transistors will turn off and isolate /csram from the processor. the isolated /csram line has a 100 k ? pullup resistor to vram (r28). this pullup re sistor keeps /csram at the vram voltage level (which under no power condition is the ba ckup battery?s regulated voltage at a little more than 2 v). transistors q3 and q4 are of opposite polarity so that a rail-to-rail voltage can be passed. when the /cs1 voltage is low, q3 will conduct. when the /cs1 voltage is high, q4 con- ducts. it takes time for the transistors to tu rn on, creating a propagation delay. this propa- gation delay is typically very small, about 10 ns to 15 ns.    b "     $ 
9  $ >a
146 edisplay (op7200)
user?s manual 147 a ppendix c. d emonstration b oard c onnections appendix c shows how to connect the demonstration board to the op7200. c.1 connecting demonstration board before running sample programs based on the demonstration board, you will have to con- nect the demonstration board from the op7200 tool kit to the op7200 board. proceed as follows. 1. use the wires included in the op7200 tool kit to connect header j1 on the demonstra- tion board to the op7200. the connections are shown in figure c-1 for sample program digin.c , in figure c-2 for sample program digout.c , and in figure c-3 for the op7200\tcpip tcp/ip sample programs. 2. make sure that your op7200 is connected to your pc and that the power supply is con- nected to the op7200 and plugged in as de scribed in chapter 2, ?getting started.?
148 edisplay (op7200) figure c-1. connections between op7200 and demonstration board for digin.c sample program    







 
 
 
 
 


 







                                  


 







             !    "                    


 







                                            #   #                                                    $            
           #   %&&'() 
                   
                "gg   #  
#   #   #      $   >   >   >   >    "gg a  a     =     =     = #
#
#
# >
>
>
> 9)#& ah
+2' a h
-
-8+:2 ; ?*"7)# 1 @ >      9,# )" ,>,")7 ?*"7) @   > > > >                   =     =     =     =  

user?s manual 149 figure c-2. connections between op7200 and demonstration board for digout.c sample program    







 
 
 
 
 


 







                                  


 







             !    "                    


 







                                            #   #                                                    $            
          #   %&&'() 
                   
                "gg   #   #   #   #      $   >   >   >   >    "gg a  a     =     =     = #
#
#
# >
>
>
> 9)#& ah
+2' a h
-
-8+:2  "  > " " " " ; ?*"7)# 1 @ 9,# )" ,>,")7 ?*"7) @   # # # #     i                    =     =     =     =  
 
150 edisplay (op7200) figure c-3. connections between op7200 and demonstration board for tcp/ip sample programs    







 
 
 
 
 


 







                                  


 







             !    "                    


 







                                            #   #                                                    $            
         #   %&&'() 
                   
               
"gg  
#  
#  
#  
#  
  
$  
>  
>  
>  
>  
 "gg a  a     =     =     = #
#
#
# >
>
>
> 9)#& ah
+2' a h
-
-8+:2     > > > >      =     =     =     =  
 ; ?*"7)# 1 @ > =>     " " " " 9,# )" ,>,")7 ?*"7) @   > > > > # # # #                            
user?s manual 151 a ppendix d. r abbit n et d.1 general rabbitnet description rabbitnet is a high-speed synchronous protoc ol developed by rabb it to connect periph- eral cards to a master and to allow them to communicate with each other. d.1.1 rabbitnet connections all rabbitnet connections are made point to point. a rabbitnet master port can only be connected directly to a peripheral card, and the number of peripheral cards is limited by the number of available rabbitnet ports on the master. figure d-1. connecting peripheral cards to a master  !& 35&  !& 35& "((  8 %'),),'##,) ( &  
( &  

152 edisplay (op7200) use a straight-through ethernet cable to connect the master to slave peripheral cards, unless you are using a device such as the op7200 that could be used either as a master or a slave. in this case you would use a crossover cable to connect an op7200 that is being used as a slave (note that dynamic c does not support the operation of the op7200 as a slave at the present time). distances between a master unit and peripheral cards can be up to 10 m or 33 ft. d.1.2 rabbitnet peripheral cards  digital i/o 24 inputs, 16 push/pull outputs, 4 channels of 10-bit a/d conversion with ranges of 0 to 10 v, 0 to 1 v, and -0.25 to +0.25 v. the following connectors are used: signal = 0.1" friction-lock connectors power = 0.156" friction-lock connectors rabbitnet = rj-45 connector  a/d converter 8 channels of programmable-gain 12-bit a/d conversion, configurable as current mea- surement and differential-input pairs. 2.5 v reference voltage is available on the connec- tor. the following connectors are used: signal = 0.1" friction-lock connectors power = 0.156" friction-lock connectors rabbitnet = rj-45 connector  d/a converter 8 channels of 0?10 v 12-bit d/a conversion. the following connectors are used: signal = 0.1" friction-lock connectors power = 0.156" friction-lock connectors rabbitnet = rj-45 connector  display/keypad interface allows you to connect your own keypad with up to 64 keys and one character liquid crys- tal display from 1 8 to 4 40 characters with or without backlight using standard 1 16 or 2 8 connectors. the following connectors are used: signal = 0.1" headers or sockets power = 0.156" friction-lock connectors rabbitnet = rj-45 connector  relay card 6 relays rated at 250 v ac, 1200 va or 100 v dc up to 240 w. the following connectors are used : relay contacts = screw-terminal connectors power = 0.156" friction-lock connectors rabbitnet = rj-45 connector visit our web site for up-to-date information about additional cards and features as they become available. the web site also has the latest revision of this user?s manual.
user?s manual 153 d.2 physical implementation there are four signaling functi ons associated with a rabbitnet connection. from the mas- ter?s point of view, the transmit function carries information and commands to the periph- eral board. the receive function is used to read back information sent to the master by the peripheral board. a clock is used to synchr onize data going between the two devices at high speed. the master is the source of this clock. a slave select (ss) function originates at the master, and when detected by a periphe ral board causes it to become selected and respond to commands received from the master. the signals themselves are differential rs-422, which are series-terminated at the source. with this type of termination, the maximu m frequency is limited by the round-trip delay time of the cable. although a peripheral board could theoretically be up to 45 m (150 ft) from the master for a data rate of 1 mhz, rabbit recommends a practical limit of 10 m (33 ft). connections between peripheral boards and ma sters are done using standard 8-conductor ethernet cables. masters and peripheral card s are equipped with rj-45 8-pin female con- nectors. the cables are nonpolarized in that they may be swapped end for end without affecting any functionality. d.2.1 control and routing control starts at the master when the master asserts the slave select signal (ss). then it simultaneously sends a serial command and cloc k. the first byte of a command contains the address of the peripheral card if more than one peripheral card is connected. a peripheral card assumes it is selected as soon as it receives the select signal. for direct master-to-peripheral-card connections, this is as soon as the master asserts the select signal. the connection is established once the se lect signal reaches the addressed slave. at this point communication between the master and the selected peripheral card is estab- lished, and data can flow in both directions simultaneously. the connection is maintained so long as the master asserts the select signal.
154 edisplay (op7200) d.3 function calls the function calls described in this section ar e used with all rabbitnet peripheral boards, and are available in the rnet.lib library in the dynamic c rabbitnet folder. if you are planning to use any of the rs-232 serial ports and the rabbitnet port on the op7200, initialize the serial port(s) before you initialize the rabbitnet port. the follow- ing sample code illustrates this sequence. // initialize serial port c, set baud rate to 19200 sercopen(19200); sercwrflush(); sercrdflush(); // initialize serial port d, set baud rate to 19200 serdopen(19200); serdwrflush(); serdrdflush(); // set serial mode...must be done after serxopen function(s) and before rabbitnet initialization sermode(0); // initialize rabbitnet port rn_init(rn_ports, 1); resets, initializes, or disables a specified rabbitnet port on the master single-board computer. during initialization, the network is enumerated and relevant tables are filled in. if the port is already initialized, calling this function forces a re-enumeration of all devices on that port. call this function first before using other rabbitnet functions. parameters portflag is a bit that represents a rabbitnet port on the master single-board computer (from 0 to the maximum number of ports). a set bit requires a service. if portflag = 0x03, both rabbitnet ports 0 and 1 will need to be serviced. servicetype enables or disables each rabbitnet port as set by the port flags. 0 = disable port 1 = enable port return value 0 int rn_init(char portflag, char servicetype);
user?s manual 155 returns an address index to device information from a given physical node address. this function will check device information to dete rmine that the peripheral board is connected to a master. parameter pna is the physical node address, indicated as a byte. 7,6?port number 5,4,3?level 1 downstream port 2,1,0?level 2 downstream port return value pointer to device information. -1 indicates that the peripheral board either cannot be identified or is not connected to the master. see also rn_find locates the first active device that matches the search criteria. parameter srch is the search criteria structure rn_search: unsigned int flags; // status flags see match macros below unsigned int ports; // port bitmask char productid; // product id char productrev; // product rev char coderev; // code rev long serialnum; // serial number use a maximum of 3 macros for the search criteria: rn_match_port // match port bitmask rn_match_pna // match physical node address rn_match_handle // match instance (reg 3) rn_match_prdid // match id/version (reg 1) rn_match_prdrev // match product revision rn_match_coderev // match code revision rn_match_sn // match serial number for example: rn_search newdev; newdev.flags = rn_match_port|rn_match_sn; newdev.ports = 0x03; //search ports 0 and 1 newdev.serialnum = e3446c01l; handle = rn_find(&newdev); return value returns the handle of the first device matching the criteria. 0 indicates no such devices were found. see also rn_device int rn_device(char pna); int rn_find(rn_search *srch);
156 edisplay (op7200) the peripheral board sends back the character the master sent. this function will check device information to determine that the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. sendecho is the character to echo back. recdata is a pointer to the return addres s of the character from the device. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master. writes a string to the specified device and register. waits for results. this function will check device infor- mation to determine that the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. regno is the command register number as designated by each device. data is a pointer to the address of the string to write to the device. datalen is the number of bytes to write (0?15). note: a data length of 0 will transmit the one-byte command register number. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master, and -2 m eans that the data length was greater than 15. see also rn_read int rn_echo(int handle, char sendecho, char *recdata); int rn_write(int handle, int regno, char *data, int datalen);
user?s manual 157 reads a string from the specified device and register. waits for results. this function will check device information to determine that the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. regno is the command register number as designated by each device. recdata is a pointer to the address of the string to read from the device. datalen is the number of bytes to read (0?15). note: a data length of 0 will transmit the one-byte command register number. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master, and -2 m eans that the data length was greater than 15. see also rn_write sends a reset sequence to the specified peripheral board. the reset takes approximately 25 ms before the peripheral board will once again execute the application. allow 1.5 seconds after the reset has completed before accessing the peripheral board. this function wi ll check peripheral board information to deter- mine that the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. resettype describes the type of reset. 0 = hard reset?equivalent to power-up. all logic is reset. 1 = soft reset?only the microprocessor logic is reset. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master. int rn_read(int handle, int regno, char *recdata, int datalen); int rn_reset(int handle, int resettype);
158 edisplay (op7200) sets software watchdog timeout period. call this function prior to enabling the software watchdog timer. this function will check device information to determine that th e peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. timeout is a timeout period from 0.025 to 6.375 seconds in increments of 0.025 seconds. entering a zero value will disable the software watchdog timer. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master. enables the hardware and/or software watchdog timers on a peripheral board. the software on the peripheral board will keep the hardware watchdog timer updated, but will hard reset if the time expires. the hardware watchdog cannot be disabled except by a hard reset on the peripheral board. the software watchdog timer must be updated by software on the master. the peripheral board will soft reset if the timeout set by rn_sw_wdt() expires. this function will check device information to determine that the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. wdttype 0 enables both hardware and software watchdog timers 1 enables hardware watchdog timer 2 enables software watchdog timer return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master. see also rn_hitwd, rn_sw_wdt int rn_sw_wdt(int handle, float timeout); int rn_enable_wdt(int handle, int wdttype);
user?s manual 159 hits software watchdog. set the timeout period and enable the software watchdog prior to using this function. this function will check device information to determine th at the peripheral board is connected to a master. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. count is a pointer to return the present count of the software watchdog timer. the equivalent time left in seconds can be determined from count 0.025 seconds. return value the status byte from the previous command. -1 m eans that device information indicates the peripheral board is not connected to the master. see also rn_enable_wdt, rn_sw_wdt reads the status of which reset occurred and whether any watchdogs are enabled. parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. retdata is a pointer to the return address of the communication byte. a set bit indicates which error occurred. this register is cleared when read. 7?hw reset has occurred 6?sw reset has occurred 5?hw watchdog enabled 4?sw watchdog enabled 3,2,1,0?reserved return value the status byte from the previous command. int rn_hitwd(int handle, char *count); int rn_rst_status(int handle, char *retdata);
160 edisplay (op7200) parameters handle is an address index to device information. use rn_device() or rn_find() to establish the handle. retdata is a pointer to the return address of the communication byte. a set bit indicates which error occurred. this register is cleared when read. 7?data available and waiting to be processed mosi (master out, slave in) 6?write collision miso (master in, slave out) 5?overrun mosi (master out, slave in) 4?mode fault, device detected hardware fault 3?data compare error detected by device 2,1,0?reserved return value the status byte from the previous command. d.3.1 status byte unless otherwise specified, functions returning a status byte will have the following format for each designated bit. int rn_comm_status(int handle, char *retdata); 7 6 5 4 3 2 1 0 00 = reserved 01 = ready 02 = busy 03 = device not connected 0 = device 1 = hub reserved for devices reserved for devices reserved for devices 0 = last command accepted 1 = last command unexecuted 0 = not expired 1 = hw or sw watchdog timer expired * * use the function rn_rst_status() to determine which timer expired.
user?s manual 161 i ndex a a/d converter ....................... 24 4?20 ma current measure- ments ............................. 27 analog reference voltage ................................. 31, 32 bipolar voltages ................. 27 calibration constants board serial number ....... 56 function calls anain .............................. 65 anaincalib ..................... 66 anaineerd .................... 71 anaineewr ................... 73 anainmamps ................. 70 anainvolts ..................... 68 negative voltages ............... 25 single-ended measure- ments ............................. 25 analog inputs see a/d converter b battery connections ............. 141 battery tab ......................... 15 board initialization function calls ..................... 58 brdinit ............................ 58 board serial number .............. 56 c ce compliance ........................ 6 design guidelines ................. 7 chip select circuit ................ 145 connections ethernet cable ................. 113 d demonstration board hookup instructions ......... 147 digital i/o sample programs ................................... 148 demonstration program ......... 11 digital i/o function calls digin .............................. 61 digout ........................... 59 smode0 .......................... 38 smode1 .......................... 38 digital inputs ......................... 20 digital outputs ....................... 21 pullup/pulldown options ... 22 tristate ................................ 22 dimensions op7200 ........................... 128 dynamic c ........................ 4, 48 add-on modules ............. 4, 49 changing programming baud rate in bios .................. 13 debugging features ............ 48 downloading updates ........ 50 installation ......................... 13 sample programs ............... 52 standard features ............... 48 debugging ...................... 48 starting .............................. 13 telephone-based technical support ...................... 4, 49 upgrades and patches ........ 49 usb port settings .............. 13 e electrostatic precautions ..... 121 emi spectrum spreader feature . 45 ethernet cables .................... 113 ethernet connections ........... 113 steps ................................ 113 ethernet port ......................... 37 handling emi and noise .... 37 pinout ................................ 37 f features .................................... 1 flash memory liefetime write cycles ........ 47 using second 256k flash memory ......................... 47 flash memory bank select ..... 39 g grounding ............................ 121 bezel ................................ 121 gnd vs. protective ground ..................................... 121 metal casing .................... 121 h headers jp1 ..................................... 35 i i/o address assignments ..... 137 installation guidelines ......... 122 introduction ............................. 1 ip addresses how to set ........................ 115 how to set pc ip address 116 j jumper configurations ......... 132 digital inputs ........... 132, 133 jp1 (rs-485 bias and termina- tion resistors) ........ 35, 134 jp2 (configure in16?in23 as digital inputs or outputs) ... 132 jumper locations .............. 132
162 edisplay (op7200) k keypad function calls keyconfig ......................96 keyget ...........................97 keyinit ............................96 keypaddef .....................98 keyprocess .....................97 keyscan .........................98 l lcd function calls glblankscreen ...............79 glblock ..........................81 glbuffunlock .................78 glfillcircle .....................83 glfillpolygon .................82 glfillvpolygon ..............82 glfontcharaddr .............85 glgetbrushtype ............80 glgetpfstep ...................84 glhscroll .......................89 glinit ..............................78 glleft1 ...........................88 glmenu ...........................76 glmenuclear ..................77 glmenuinit .....................75 glplotcircle ....................83 glplotdot .......................80 glplotline ......................80 glplotpolygon ................81 glplotvpolygon .............82 glprintf ...........................84 glputchar .......................85 glputfont .......................85 glrefreshmenu ..............76 glright1 .........................88 glsetpfstep ....................84 glswap ...........................78 glup1 .............................89 glvscroll .......................90 glxfontinit ....................83 glxgetbitmap ...............91 glxgetfastmap ..............92 glxputbitmap ................90 glxputfastmap ..............91 textborder .....................92 textborderinit ...............92 textcursorlocation .......87 textgotoxy ..................86 textmaxchars ...............93 textprintf .......................88 textputchar ...................87 textwindowframe ........86 lcd controller ................40, 50 handling applications devel- oped for older chip ........50 identifying new part ..........40 lcd screen control function calls glanimation ...................94 glbacklight ...................94 gldisponoff ..................95 glrealtime .....................94 glsetcontrast .................95 m memory .................................39 models .....................................2 op7200 ................................2 op7210 ................................2 mounting and installation .............................123, 124 o op7200 introduction .........................1 overlay cleaning instructions ........125 p peripheral cards .......................5 connection to master 151, 152 physical mounting ...............130 pinout ethernet port ......................37 op7200 headers ................18 power management .............139 power supply ...................3, 139 backup battery circuit ......143 battery backup .................141 chip select circuit .............145 connections ........................10 switching voltage regulator ... 139 vram switch .................144 power-up demonstration program .....11 programming flash vs. ram ...................47 programming cable ..............3 programming port ..............38 programming cable .................3 connections ........................12 prog connector ...............44 programming port .................38 r rabbit 2000 parallel ports ....................135 rabbitnet ................................5 ethernet cables to connect peripheral cards ...151, 152 function calls rn_comm_status ...........160 rn_device .....................155 rn_echo ........................156 rn_find .........................155 rn_hitwd .......................159 rn_init ..........................154 rn_read .........................157 rn_reset ........................157 rn_rst_status .................159 rn_write .......................156 general description ..........151 hardware configuration .....36 peripheral cards ...............152 physical implementation .153 rabbitnet port ...................36 use of serial port b ...........36 rabbitnet port function calls ...................111 rn_sp_close ..................111 rn_sp_disable ...............112 rn_sp_enable ................112 rn_sp_info ....................111 macros .............................111 real-time clock how to set ..........................15 reset .......................................10 hardware ............................10 reset generator .................144 rs-485 network ....................34 termination and bias resis- tors ................................35
user?s manual 163 s sample programs ................... 52 a/d converter adcal_diff_2v.c .... 54 adcal_diff_gnd.c 54 adcal_ma_ch.c ..... 54 adcal_se_all.c ..... 54 adcal_se_ch.c ....... 54 adrd_diff_2v.c ...... 54 adrd_diff_gnd.c ............................... 30, 54 adrd_ma_ch.c .. 30, 54 adrd_se_all.c ....... 54 adrd_se_ch.c ......... 54 board_id.c ................... 52 calibration constants getcalib.c ............... 56 savecalib.c ............ 56 digital i/o buzzer.c ................... 52 digbankout.c ........ 52 digin.c ........ 52, 147, 148 digout.c .... 52, 147, 149 led.c ........................... 52 pwm.c ......................... 52 fun.c ......................... 11, 52 graphic display bufflock.c .............. 55 contrast.c .............. 55 primitives.c ............ 55 scrolling.c ............ 55 text.c ......................... 55 how to set ip address ...... 115 keypad kp_16key.c ................ 55 kp_analog.c ........... 55 kp_basic.c ................ 55 kp_menu.c ................ 55 op7200 features ................ 14 pong.c ............................ 14 power-up demonstration program ......................... 11 real-time clock rtc_test.c ................ 15 setrtckb.c .............. 15 serial communication simple3wire.c ........ 53 simple485master.c 54 simple485slave.c .. 54 tcp/ip ............ 115, 147, 150 flash_xml.c ......... 118 pingme.c .................. 117 ssi.c ........................... 118 telnet.c .................. 118 touchscreen btn_16key.c ............. 55 btn_basics.c ........... 55 btn_keyboard.c ... 55 cal_touchscreen.c ..................................... 55 rd_touchscreen.c ..................................... 55 tscust16key.lib .... 55 tscustkeyboard.lib ..................................... 55 user block userblock_clear.c ..................................... 56 userblock_info.c 56 serial communication flow control ....................... 64 function calls ser485rx ....................... 64 ser485tx ....................... 64 sercflowcontroloff ....... 64 sercflowcontrolon ........ 64 sermode ......................... 64 programming port ............. 38 rs-232 description ........... 34 rs-485 network ................ 34 rs-485 termination and bias resistors ......................... 35 serial ports ethernet port ..................... 37 rabbitnet port ................... 36 setup ...................................... 10 power supply connections . 10 programming cable connec- tions .............................. 12 software .................................. 4 libraries ............................. 57 displays ......................... 57 keypads ......................... 57 op7200 ......................... 57 op72xx.lib .................. 57 packet.lib .... 33, 63, 64 rabbitnet ...................... 57 rn_cfg_op72.lib ..... 57 rnet.lib ................... 154 rs232.lib .............. 63, 64 touchscreens .................. 57 macros use_2ndflash_code ..................................... 47 using second 256k flash memory ......................... 47 specifications header footprint ............... 130 op7200 dimensions .................. 128 electrical ...................... 129 temperature ................. 129 physical mounting ........... 130 relative pin 1 locations .... 130 spectrum spreader ................. 45 subsystems ............................ 17 t tcp/ip connections ............ 113 10base-t ethernet card .. 113 additional resources ........ 119 ethernet hub .................... 113 steps ................................ 113 tool kit ................................... 3 ac adapter .......................... 3 dc power supply ................ 3 dynamic c software ........... 3 programming cable ............. 3 software ............................... 3 user?s manual ..................... 3 wire assembly ..................... 3 touchscreen function calls btnattributes ............... 106 btnclear ....................... 105 btnclearlevel .............. 105 btnclearregion ........... 103 btncreatebitmap ......... 102 btncreatetext .............. 101 btndisplay ................... 104 btndisplaylevel .......... 105 btndisplaytext ............ 103 btnget .......................... 107 btninit ............................ 99 btnmsgbox .................. 104 btnrecall ..................... 100 btnsearchxy ............... 106 btnstore ......................... 99 btnverifyxy ............... 107 tsactive ...................... 109 tscalib ........................ 108 tscalibeerd .............. 108 tscalibeewr .............. 108 tsscanstate ................. 109 tsxybuffer ................ 110 tsxyvector ................. 109 touchscreen operation ........... 31 u usb/serial port converter ..... 12 dynamic c settings ........... 13
164 edisplay (op7200)
user?s manual 165 s chematics 090-0120 rcm2200 schematic www.rabbit.com/documentation/schemat/090-0120.pdf 090-0138 op7200 schematic www.rabbit.com/documentation/schemat/090-0138.pdf 090-0042 demonstration board schematic www.rabbit.com/documentation/schemat/090-0042.pdf 090-0128 programming cable schematic www.rabbit.com/documentation/schemat/090-0128.pdf you may use the url information provided above to access the latest schematics directly.


▲Up To Search▲   

 
Price & Availability of 101-0536

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X